z80 assembler and linker now part of ./configure ; make ; make install
[fw/sdcc] / 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=Makefile
455
456 # Find the source files, if location was not specified.
457 if test -z "$srcdir"; then
458   ac_srcdir_defaulted=yes
459   # Try the directory containing this script, then its parent.
460   ac_prog=$0
461   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
462   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
463   srcdir=$ac_confdir
464   if test ! -r $srcdir/$ac_unique_file; then
465     srcdir=..
466   fi
467 else
468   ac_srcdir_defaulted=no
469 fi
470 if test ! -r $srcdir/$ac_unique_file; then
471   if test "$ac_srcdir_defaulted" = yes; then
472     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
473   else
474     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
475   fi
476 fi
477 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
478
479 # Prefer explicitly selected file to automatically selected ones.
480 if test -z "$CONFIG_SITE"; then
481   if test "x$prefix" != xNONE; then
482     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
483   else
484     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
485   fi
486 fi
487 for ac_site_file in $CONFIG_SITE; do
488   if test -r "$ac_site_file"; then
489     echo "loading site script $ac_site_file"
490     . "$ac_site_file"
491   fi
492 done
493
494 if test -r "$cache_file"; then
495   echo "loading cache $cache_file"
496   . $cache_file
497 else
498   echo "creating cache $cache_file"
499   > $cache_file
500 fi
501
502 ac_ext=c
503 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
504 ac_cpp='$CPP $CPPFLAGS'
505 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
506 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
507 cross_compiling=$ac_cv_prog_cc_cross
508
509 ac_exeext=
510 ac_objext=o
511 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
512   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
513   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
514     ac_n= ac_c='
515 ' ac_t='        '
516   else
517     ac_n=-n ac_c= ac_t=
518   fi
519 else
520   ac_n= ac_c='\c' ac_t=
521 fi
522
523
524
525
526 for ac_prog in gawk mawk nawk awk
527 do
528 # Extract the first word of "$ac_prog", so it can be a program name with args.
529 set dummy $ac_prog; ac_word=$2
530 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
531 echo "configure:532: checking for $ac_word" >&5
532 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
533   echo $ac_n "(cached) $ac_c" 1>&6
534 else
535   if test -n "$AWK"; then
536   ac_cv_prog_AWK="$AWK" # Let the user override the test.
537 else
538   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
539   ac_dummy="$PATH"
540   for ac_dir in $ac_dummy; do
541     test -z "$ac_dir" && ac_dir=.
542     if test -f $ac_dir/$ac_word; then
543       ac_cv_prog_AWK="$ac_prog"
544       break
545     fi
546   done
547   IFS="$ac_save_ifs"
548 fi
549 fi
550 AWK="$ac_cv_prog_AWK"
551 if test -n "$AWK"; then
552   echo "$ac_t""$AWK" 1>&6
553 else
554   echo "$ac_t""no" 1>&6
555 fi
556
557 test -n "$AWK" && break
558 done
559
560
561 echo $ac_n "checking version of the package""... $ac_c" 1>&6
562 echo "configure:563: checking version of the package" >&5
563 if test -f .version; then
564   VERSION=`cat .version`
565 elif test -f ../.version; then
566   VERSION=`cat ../.version`
567 else
568   VERSION="0.0.0"
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 echo "$ac_t""${VERSION}" 1>&6
574
575
576
577
578 cat >> confdefs.h <<EOF
579 #define SDCC_VERSION_LO ${VERSIONLO}
580 EOF
581
582 cat >> confdefs.h <<EOF
583 #define SDCC_VERSION_HI ${VERSIONHI}
584 EOF
585
586 cat >> confdefs.h <<EOF
587 #define SDCC_VERSION_P ${VERSIONP}
588 EOF
589
590 cat >> confdefs.h <<EOF
591 #define SDCC_VERSION_STR "${VERSION}"
592 EOF
593
594 sdcc_cv_version=$VERSION
595 sdcc_cv_versionhi=$VERSIONHI
596 sdcc_cv_versionlo=$VERSIONLO
597 sdcc_cv_versionp=$VERSIONP
598
599 # Required programs
600 #-------------------
601 # Extract the first word of "gcc", so it can be a program name with args.
602 set dummy gcc; ac_word=$2
603 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
604 echo "configure:605: checking for $ac_word" >&5
605 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
606   echo $ac_n "(cached) $ac_c" 1>&6
607 else
608   if test -n "$CC"; then
609   ac_cv_prog_CC="$CC" # Let the user override the test.
610 else
611   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
612   ac_dummy="$PATH"
613   for ac_dir in $ac_dummy; do
614     test -z "$ac_dir" && ac_dir=.
615     if test -f $ac_dir/$ac_word; then
616       ac_cv_prog_CC="gcc"
617       break
618     fi
619   done
620   IFS="$ac_save_ifs"
621 fi
622 fi
623 CC="$ac_cv_prog_CC"
624 if test -n "$CC"; then
625   echo "$ac_t""$CC" 1>&6
626 else
627   echo "$ac_t""no" 1>&6
628 fi
629
630 if test -z "$CC"; then
631   # Extract the first word of "cc", so it can be a program name with args.
632 set dummy cc; ac_word=$2
633 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
634 echo "configure:635: checking for $ac_word" >&5
635 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
636   echo $ac_n "(cached) $ac_c" 1>&6
637 else
638   if test -n "$CC"; then
639   ac_cv_prog_CC="$CC" # Let the user override the test.
640 else
641   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
642   ac_prog_rejected=no
643   ac_dummy="$PATH"
644   for ac_dir in $ac_dummy; do
645     test -z "$ac_dir" && ac_dir=.
646     if test -f $ac_dir/$ac_word; then
647       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
648         ac_prog_rejected=yes
649         continue
650       fi
651       ac_cv_prog_CC="cc"
652       break
653     fi
654   done
655   IFS="$ac_save_ifs"
656 if test $ac_prog_rejected = yes; then
657   # We found a bogon in the path, so make sure we never use it.
658   set dummy $ac_cv_prog_CC
659   shift
660   if test $# -gt 0; then
661     # We chose a different compiler from the bogus one.
662     # However, it has the same basename, so the bogon will be chosen
663     # first if we set CC to just the basename; use the full file name.
664     shift
665     set dummy "$ac_dir/$ac_word" "$@"
666     shift
667     ac_cv_prog_CC="$@"
668   fi
669 fi
670 fi
671 fi
672 CC="$ac_cv_prog_CC"
673 if test -n "$CC"; then
674   echo "$ac_t""$CC" 1>&6
675 else
676   echo "$ac_t""no" 1>&6
677 fi
678
679   if test -z "$CC"; then
680     case "`uname -s`" in
681     *win32* | *WIN32*)
682       # Extract the first word of "cl", so it can be a program name with args.
683 set dummy cl; ac_word=$2
684 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
685 echo "configure:686: checking for $ac_word" >&5
686 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
687   echo $ac_n "(cached) $ac_c" 1>&6
688 else
689   if test -n "$CC"; then
690   ac_cv_prog_CC="$CC" # Let the user override the test.
691 else
692   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
693   ac_dummy="$PATH"
694   for ac_dir in $ac_dummy; do
695     test -z "$ac_dir" && ac_dir=.
696     if test -f $ac_dir/$ac_word; then
697       ac_cv_prog_CC="cl"
698       break
699     fi
700   done
701   IFS="$ac_save_ifs"
702 fi
703 fi
704 CC="$ac_cv_prog_CC"
705 if test -n "$CC"; then
706   echo "$ac_t""$CC" 1>&6
707 else
708   echo "$ac_t""no" 1>&6
709 fi
710  ;;
711     esac
712   fi
713   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
714 fi
715
716 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
717 echo "configure:718: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
718
719 ac_ext=c
720 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
721 ac_cpp='$CPP $CPPFLAGS'
722 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
723 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
724 cross_compiling=$ac_cv_prog_cc_cross
725
726 cat > conftest.$ac_ext << EOF
727
728 #line 729 "configure"
729 #include "confdefs.h"
730
731 main(){return(0);}
732 EOF
733 if { (eval echo configure:734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
734   ac_cv_prog_cc_works=yes
735   # If we can't run a trivial program, we are probably using a cross compiler.
736   if (./conftest; exit) 2>/dev/null; then
737     ac_cv_prog_cc_cross=no
738   else
739     ac_cv_prog_cc_cross=yes
740   fi
741 else
742   echo "configure: failed program was:" >&5
743   cat conftest.$ac_ext >&5
744   ac_cv_prog_cc_works=no
745 fi
746 rm -fr conftest*
747 ac_ext=c
748 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
749 ac_cpp='$CPP $CPPFLAGS'
750 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
751 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
752 cross_compiling=$ac_cv_prog_cc_cross
753
754 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
755 if test $ac_cv_prog_cc_works = no; then
756   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
757 fi
758 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
759 echo "configure:760: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
760 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
761 cross_compiling=$ac_cv_prog_cc_cross
762
763 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
764 echo "configure:765: checking whether we are using GNU C" >&5
765 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
766   echo $ac_n "(cached) $ac_c" 1>&6
767 else
768   cat > conftest.c <<EOF
769 #ifdef __GNUC__
770   yes;
771 #endif
772 EOF
773 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
774   ac_cv_prog_gcc=yes
775 else
776   ac_cv_prog_gcc=no
777 fi
778 fi
779
780 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
781
782 if test $ac_cv_prog_gcc = yes; then
783   GCC=yes
784 else
785   GCC=
786 fi
787
788 ac_test_CFLAGS="${CFLAGS+set}"
789 ac_save_CFLAGS="$CFLAGS"
790 CFLAGS=
791 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
792 echo "configure:793: checking whether ${CC-cc} accepts -g" >&5
793 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
794   echo $ac_n "(cached) $ac_c" 1>&6
795 else
796   echo 'void f(){}' > conftest.c
797 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
798   ac_cv_prog_cc_g=yes
799 else
800   ac_cv_prog_cc_g=no
801 fi
802 rm -f conftest*
803
804 fi
805
806 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
807 if test "$ac_test_CFLAGS" = set; then
808   CFLAGS="$ac_save_CFLAGS"
809 elif test $ac_cv_prog_cc_g = yes; then
810   if test "$GCC" = yes; then
811     CFLAGS="-g -O2"
812   else
813     CFLAGS="-g"
814   fi
815 else
816   if test "$GCC" = yes; then
817     CFLAGS="-O2"
818   else
819     CFLAGS=
820   fi
821 fi
822
823 for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
824 do
825 # Extract the first word of "$ac_prog", so it can be a program name with args.
826 set dummy $ac_prog; ac_word=$2
827 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
828 echo "configure:829: checking for $ac_word" >&5
829 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
830   echo $ac_n "(cached) $ac_c" 1>&6
831 else
832   if test -n "$CXX"; then
833   ac_cv_prog_CXX="$CXX" # Let the user override the test.
834 else
835   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
836   ac_dummy="$PATH"
837   for ac_dir in $ac_dummy; do
838     test -z "$ac_dir" && ac_dir=.
839     if test -f $ac_dir/$ac_word; then
840       ac_cv_prog_CXX="$ac_prog"
841       break
842     fi
843   done
844   IFS="$ac_save_ifs"
845 fi
846 fi
847 CXX="$ac_cv_prog_CXX"
848 if test -n "$CXX"; then
849   echo "$ac_t""$CXX" 1>&6
850 else
851   echo "$ac_t""no" 1>&6
852 fi
853
854 test -n "$CXX" && break
855 done
856 test -n "$CXX" || CXX="gcc"
857
858
859 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
860 echo "configure:861: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
861
862 ac_ext=C
863 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
864 ac_cpp='$CXXCPP $CPPFLAGS'
865 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
866 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
867 cross_compiling=$ac_cv_prog_cxx_cross
868
869 cat > conftest.$ac_ext << EOF
870
871 #line 872 "configure"
872 #include "confdefs.h"
873
874 int main(){return(0);}
875 EOF
876 if { (eval echo configure:877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
877   ac_cv_prog_cxx_works=yes
878   # If we can't run a trivial program, we are probably using a cross compiler.
879   if (./conftest; exit) 2>/dev/null; then
880     ac_cv_prog_cxx_cross=no
881   else
882     ac_cv_prog_cxx_cross=yes
883   fi
884 else
885   echo "configure: failed program was:" >&5
886   cat conftest.$ac_ext >&5
887   ac_cv_prog_cxx_works=no
888 fi
889 rm -fr conftest*
890 ac_ext=c
891 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
892 ac_cpp='$CPP $CPPFLAGS'
893 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
894 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
895 cross_compiling=$ac_cv_prog_cc_cross
896
897 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
898 if test $ac_cv_prog_cxx_works = no; then
899   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
900 fi
901 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
902 echo "configure:903: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
903 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
904 cross_compiling=$ac_cv_prog_cxx_cross
905
906 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
907 echo "configure:908: checking whether we are using GNU C++" >&5
908 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
909   echo $ac_n "(cached) $ac_c" 1>&6
910 else
911   cat > conftest.C <<EOF
912 #ifdef __GNUC__
913   yes;
914 #endif
915 EOF
916 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
917   ac_cv_prog_gxx=yes
918 else
919   ac_cv_prog_gxx=no
920 fi
921 fi
922
923 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
924
925 if test $ac_cv_prog_gxx = yes; then
926   GXX=yes
927 else
928   GXX=
929 fi
930
931 ac_test_CXXFLAGS="${CXXFLAGS+set}"
932 ac_save_CXXFLAGS="$CXXFLAGS"
933 CXXFLAGS=
934 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
935 echo "configure:936: checking whether ${CXX-g++} accepts -g" >&5
936 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
937   echo $ac_n "(cached) $ac_c" 1>&6
938 else
939   echo 'void f(){}' > conftest.cc
940 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
941   ac_cv_prog_cxx_g=yes
942 else
943   ac_cv_prog_cxx_g=no
944 fi
945 rm -f conftest*
946
947 fi
948
949 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
950 if test "$ac_test_CXXFLAGS" = set; then
951   CXXFLAGS="$ac_save_CXXFLAGS"
952 elif test $ac_cv_prog_cxx_g = yes; then
953   if test "$GXX" = yes; then
954     CXXFLAGS="-g -O2"
955   else
956     CXXFLAGS="-g"
957   fi
958 else
959   if test "$GXX" = yes; then
960     CXXFLAGS="-O2"
961   else
962     CXXFLAGS=
963   fi
964 fi
965
966 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
967 echo "configure:968: checking how to run the C preprocessor" >&5
968 # On Suns, sometimes $CPP names a directory.
969 if test -n "$CPP" && test -d "$CPP"; then
970   CPP=
971 fi
972 if test -z "$CPP"; then
973 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
974   echo $ac_n "(cached) $ac_c" 1>&6
975 else
976     # This must be in double quotes, not single quotes, because CPP may get
977   # substituted into the Makefile and "${CC-cc}" will confuse make.
978   CPP="${CC-cc} -E"
979   # On the NeXT, cc -E runs the code through the compiler's parser,
980   # not just through cpp.
981   cat > conftest.$ac_ext <<EOF
982 #line 983 "configure"
983 #include "confdefs.h"
984 #include <assert.h>
985 Syntax Error
986 EOF
987 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
988 { (eval echo configure:989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
989 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
990 if test -z "$ac_err"; then
991   :
992 else
993   echo "$ac_err" >&5
994   echo "configure: failed program was:" >&5
995   cat conftest.$ac_ext >&5
996   rm -rf conftest*
997   CPP="${CC-cc} -E -traditional-cpp"
998   cat > conftest.$ac_ext <<EOF
999 #line 1000 "configure"
1000 #include "confdefs.h"
1001 #include <assert.h>
1002 Syntax Error
1003 EOF
1004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1005 { (eval echo configure:1006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1006 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1007 if test -z "$ac_err"; then
1008   :
1009 else
1010   echo "$ac_err" >&5
1011   echo "configure: failed program was:" >&5
1012   cat conftest.$ac_ext >&5
1013   rm -rf conftest*
1014   CPP="${CC-cc} -nologo -E"
1015   cat > conftest.$ac_ext <<EOF
1016 #line 1017 "configure"
1017 #include "confdefs.h"
1018 #include <assert.h>
1019 Syntax Error
1020 EOF
1021 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1022 { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1023 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1024 if test -z "$ac_err"; then
1025   :
1026 else
1027   echo "$ac_err" >&5
1028   echo "configure: failed program was:" >&5
1029   cat conftest.$ac_ext >&5
1030   rm -rf conftest*
1031   CPP=/lib/cpp
1032 fi
1033 rm -f conftest*
1034 fi
1035 rm -f conftest*
1036 fi
1037 rm -f conftest*
1038   ac_cv_prog_CPP="$CPP"
1039 fi
1040   CPP="$ac_cv_prog_CPP"
1041 else
1042   ac_cv_prog_CPP="$CPP"
1043 fi
1044 echo "$ac_t""$CPP" 1>&6
1045
1046 ac_aux_dir=
1047 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1048   if test -f $ac_dir/install-sh; then
1049     ac_aux_dir=$ac_dir
1050     ac_install_sh="$ac_aux_dir/install-sh -c"
1051     break
1052   elif test -f $ac_dir/install.sh; then
1053     ac_aux_dir=$ac_dir
1054     ac_install_sh="$ac_aux_dir/install.sh -c"
1055     break
1056   fi
1057 done
1058 if test -z "$ac_aux_dir"; then
1059   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
1060 fi
1061 ac_config_guess=$ac_aux_dir/config.guess
1062 ac_config_sub=$ac_aux_dir/config.sub
1063 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1064
1065 # Find a good install program.  We prefer a C program (faster),
1066 # so one script is as good as another.  But avoid the broken or
1067 # incompatible versions:
1068 # SysV /etc/install, /usr/sbin/install
1069 # SunOS /usr/etc/install
1070 # IRIX /sbin/install
1071 # AIX /bin/install
1072 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1073 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1074 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1075 # ./install, which can be erroneously created by make from ./install.sh.
1076 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1077 echo "configure:1078: checking for a BSD compatible install" >&5
1078 if test -z "$INSTALL"; then
1079 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1080   echo $ac_n "(cached) $ac_c" 1>&6
1081 else
1082     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1083   for ac_dir in $PATH; do
1084     # Account for people who put trailing slashes in PATH elements.
1085     case "$ac_dir/" in
1086     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1087     *)
1088       # OSF1 and SCO ODT 3.0 have their own names for install.
1089       # Don't use installbsd from OSF since it installs stuff as root
1090       # by default.
1091       for ac_prog in ginstall scoinst install; do
1092         if test -f $ac_dir/$ac_prog; then
1093           if test $ac_prog = install &&
1094             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1095             # AIX install.  It has an incompatible calling convention.
1096             :
1097           else
1098             ac_cv_path_install="$ac_dir/$ac_prog -c"
1099             break 2
1100           fi
1101         fi
1102       done
1103       ;;
1104     esac
1105   done
1106   IFS="$ac_save_IFS"
1107
1108 fi
1109   if test "${ac_cv_path_install+set}" = set; then
1110     INSTALL="$ac_cv_path_install"
1111   else
1112     # As a last resort, use the slow shell script.  We don't cache a
1113     # path for INSTALL within a source directory, because that will
1114     # break other packages using the cache if that directory is
1115     # removed, or if the path is relative.
1116     INSTALL="$ac_install_sh"
1117   fi
1118 fi
1119 echo "$ac_t""$INSTALL" 1>&6
1120
1121 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1122 # It thinks the first close brace ends the variable substitution.
1123 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1124
1125 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1126
1127 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1128
1129 # Extract the first word of "ranlib", so it can be a program name with args.
1130 set dummy ranlib; ac_word=$2
1131 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1132 echo "configure:1133: checking for $ac_word" >&5
1133 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1134   echo $ac_n "(cached) $ac_c" 1>&6
1135 else
1136   if test -n "$RANLIB"; then
1137   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1138 else
1139   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1140   ac_dummy="$PATH"
1141   for ac_dir in $ac_dummy; do
1142     test -z "$ac_dir" && ac_dir=.
1143     if test -f $ac_dir/$ac_word; then
1144       ac_cv_prog_RANLIB="ranlib"
1145       break
1146     fi
1147   done
1148   IFS="$ac_save_ifs"
1149   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1150 fi
1151 fi
1152 RANLIB="$ac_cv_prog_RANLIB"
1153 if test -n "$RANLIB"; then
1154   echo "$ac_t""$RANLIB" 1>&6
1155 else
1156   echo "$ac_t""no" 1>&6
1157 fi
1158
1159 for ac_prog in 'bison -y' byacc
1160 do
1161 # Extract the first word of "$ac_prog", so it can be a program name with args.
1162 set dummy $ac_prog; ac_word=$2
1163 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1164 echo "configure:1165: checking for $ac_word" >&5
1165 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
1166   echo $ac_n "(cached) $ac_c" 1>&6
1167 else
1168   if test -n "$YACC"; then
1169   ac_cv_prog_YACC="$YACC" # Let the user override the test.
1170 else
1171   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1172   ac_dummy="$PATH"
1173   for ac_dir in $ac_dummy; do
1174     test -z "$ac_dir" && ac_dir=.
1175     if test -f $ac_dir/$ac_word; then
1176       ac_cv_prog_YACC="$ac_prog"
1177       break
1178     fi
1179   done
1180   IFS="$ac_save_ifs"
1181 fi
1182 fi
1183 YACC="$ac_cv_prog_YACC"
1184 if test -n "$YACC"; then
1185   echo "$ac_t""$YACC" 1>&6
1186 else
1187   echo "$ac_t""no" 1>&6
1188 fi
1189
1190 test -n "$YACC" && break
1191 done
1192 test -n "$YACC" || YACC="yacc"
1193
1194 # Extract the first word of "flex", so it can be a program name with args.
1195 set dummy flex; ac_word=$2
1196 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1197 echo "configure:1198: checking for $ac_word" >&5
1198 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
1199   echo $ac_n "(cached) $ac_c" 1>&6
1200 else
1201   if test -n "$LEX"; then
1202   ac_cv_prog_LEX="$LEX" # Let the user override the test.
1203 else
1204   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1205   ac_dummy="$PATH"
1206   for ac_dir in $ac_dummy; do
1207     test -z "$ac_dir" && ac_dir=.
1208     if test -f $ac_dir/$ac_word; then
1209       ac_cv_prog_LEX="flex"
1210       break
1211     fi
1212   done
1213   IFS="$ac_save_ifs"
1214   test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
1215 fi
1216 fi
1217 LEX="$ac_cv_prog_LEX"
1218 if test -n "$LEX"; then
1219   echo "$ac_t""$LEX" 1>&6
1220 else
1221   echo "$ac_t""no" 1>&6
1222 fi
1223
1224 if test -z "$LEXLIB"
1225 then
1226   case "$LEX" in
1227   flex*) ac_lib=fl ;;
1228   *) ac_lib=l ;;
1229   esac
1230   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
1231 echo "configure:1232: checking for yywrap in -l$ac_lib" >&5
1232 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
1233 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1234   echo $ac_n "(cached) $ac_c" 1>&6
1235 else
1236   ac_save_LIBS="$LIBS"
1237 LIBS="-l$ac_lib  $LIBS"
1238 cat > conftest.$ac_ext <<EOF
1239 #line 1240 "configure"
1240 #include "confdefs.h"
1241 /* Override any gcc2 internal prototype to avoid an error.  */
1242 /* We use char because int might match the return type of a gcc2
1243     builtin and then its argument prototype would still apply.  */
1244 char yywrap();
1245
1246 int main() {
1247 yywrap()
1248 ; return 0; }
1249 EOF
1250 if { (eval echo configure:1251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1251   rm -rf conftest*
1252   eval "ac_cv_lib_$ac_lib_var=yes"
1253 else
1254   echo "configure: failed program was:" >&5
1255   cat conftest.$ac_ext >&5
1256   rm -rf conftest*
1257   eval "ac_cv_lib_$ac_lib_var=no"
1258 fi
1259 rm -f conftest*
1260 LIBS="$ac_save_LIBS"
1261
1262 fi
1263 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1264   echo "$ac_t""yes" 1>&6
1265   LEXLIB="-l$ac_lib"
1266 else
1267   echo "$ac_t""no" 1>&6
1268 fi
1269
1270 fi
1271
1272 # Extract the first word of "autoconf", so it can be a program name with args.
1273 set dummy autoconf; ac_word=$2
1274 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1275 echo "configure:1276: checking for $ac_word" >&5
1276 if eval "test \"`echo '$''{'ac_cv_prog_AUTOCONF'+set}'`\" = set"; then
1277   echo $ac_n "(cached) $ac_c" 1>&6
1278 else
1279   if test -n "$AUTOCONF"; then
1280   ac_cv_prog_AUTOCONF="$AUTOCONF" # Let the user override the test.
1281 else
1282   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1283   ac_dummy="$PATH"
1284   for ac_dir in $ac_dummy; do
1285     test -z "$ac_dir" && ac_dir=.
1286     if test -f $ac_dir/$ac_word; then
1287       ac_cv_prog_AUTOCONF="autoconf"
1288       break
1289     fi
1290   done
1291   IFS="$ac_save_ifs"
1292   test -z "$ac_cv_prog_AUTOCONF" && ac_cv_prog_AUTOCONF=":"
1293 fi
1294 fi
1295 AUTOCONF="$ac_cv_prog_AUTOCONF"
1296 if test -n "$AUTOCONF"; then
1297   echo "$ac_t""$AUTOCONF" 1>&6
1298 else
1299   echo "$ac_t""no" 1>&6
1300 fi
1301
1302 # Extract the first word of "as", so it can be a program name with args.
1303 set dummy as; ac_word=$2
1304 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1305 echo "configure:1306: checking for $ac_word" >&5
1306 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
1307   echo $ac_n "(cached) $ac_c" 1>&6
1308 else
1309   if test -n "$AS"; then
1310   ac_cv_prog_AS="$AS" # Let the user override the test.
1311 else
1312   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1313   ac_dummy="$PATH"
1314   for ac_dir in $ac_dummy; do
1315     test -z "$ac_dir" && ac_dir=.
1316     if test -f $ac_dir/$ac_word; then
1317       ac_cv_prog_AS="as"
1318       break
1319     fi
1320   done
1321   IFS="$ac_save_ifs"
1322   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS=":"
1323 fi
1324 fi
1325 AS="$ac_cv_prog_AS"
1326 if test -n "$AS"; then
1327   echo "$ac_t""$AS" 1>&6
1328 else
1329   echo "$ac_t""no" 1>&6
1330 fi
1331
1332 # Extract the first word of "cp", so it can be a program name with args.
1333 set dummy cp; ac_word=$2
1334 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1335 echo "configure:1336: checking for $ac_word" >&5
1336 if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then
1337   echo $ac_n "(cached) $ac_c" 1>&6
1338 else
1339   if test -n "$CP"; then
1340   ac_cv_prog_CP="$CP" # Let the user override the test.
1341 else
1342   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1343   ac_dummy="$PATH"
1344   for ac_dir in $ac_dummy; do
1345     test -z "$ac_dir" && ac_dir=.
1346     if test -f $ac_dir/$ac_word; then
1347       ac_cv_prog_CP="cp"
1348       break
1349     fi
1350   done
1351   IFS="$ac_save_ifs"
1352   test -z "$ac_cv_prog_CP" && ac_cv_prog_CP=":"
1353 fi
1354 fi
1355 CP="$ac_cv_prog_CP"
1356 if test -n "$CP"; then
1357   echo "$ac_t""$CP" 1>&6
1358 else
1359   echo "$ac_t""no" 1>&6
1360 fi
1361
1362
1363 ac_ext=c
1364 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1365 ac_cpp='$CPP $CPPFLAGS'
1366 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1367 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1368 cross_compiling=$ac_cv_prog_cc_cross
1369
1370
1371 # Checking for header files.
1372 # ===========================================================================
1373 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1374 echo "configure:1375: checking for ANSI C header files" >&5
1375 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1376   echo $ac_n "(cached) $ac_c" 1>&6
1377 else
1378   cat > conftest.$ac_ext <<EOF
1379 #line 1380 "configure"
1380 #include "confdefs.h"
1381 #include <stdlib.h>
1382 #include <stdarg.h>
1383 #include <string.h>
1384 #include <float.h>
1385 EOF
1386 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1387 { (eval echo configure:1388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1388 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1389 if test -z "$ac_err"; then
1390   rm -rf conftest*
1391   ac_cv_header_stdc=yes
1392 else
1393   echo "$ac_err" >&5
1394   echo "configure: failed program was:" >&5
1395   cat conftest.$ac_ext >&5
1396   rm -rf conftest*
1397   ac_cv_header_stdc=no
1398 fi
1399 rm -f conftest*
1400
1401 if test $ac_cv_header_stdc = yes; then
1402   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1403 cat > conftest.$ac_ext <<EOF
1404 #line 1405 "configure"
1405 #include "confdefs.h"
1406 #include <string.h>
1407 EOF
1408 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1409   egrep "memchr" >/dev/null 2>&1; then
1410   :
1411 else
1412   rm -rf conftest*
1413   ac_cv_header_stdc=no
1414 fi
1415 rm -f conftest*
1416
1417 fi
1418
1419 if test $ac_cv_header_stdc = yes; then
1420   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1421 cat > conftest.$ac_ext <<EOF
1422 #line 1423 "configure"
1423 #include "confdefs.h"
1424 #include <stdlib.h>
1425 EOF
1426 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1427   egrep "free" >/dev/null 2>&1; then
1428   :
1429 else
1430   rm -rf conftest*
1431   ac_cv_header_stdc=no
1432 fi
1433 rm -f conftest*
1434
1435 fi
1436
1437 if test $ac_cv_header_stdc = yes; then
1438   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1439 if test "$cross_compiling" = yes; then
1440   :
1441 else
1442   cat > conftest.$ac_ext <<EOF
1443 #line 1444 "configure"
1444 #include "confdefs.h"
1445 #include <ctype.h>
1446 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1447 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1448 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1449 int main () { int i; for (i = 0; i < 256; i++)
1450 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1451 exit (0); }
1452
1453 EOF
1454 if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1455 then
1456   :
1457 else
1458   echo "configure: failed program was:" >&5
1459   cat conftest.$ac_ext >&5
1460   rm -fr conftest*
1461   ac_cv_header_stdc=no
1462 fi
1463 rm -fr conftest*
1464 fi
1465
1466 fi
1467 fi
1468
1469 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1470 if test $ac_cv_header_stdc = yes; then
1471   cat >> confdefs.h <<\EOF
1472 #define STDC_HEADERS 1
1473 EOF
1474
1475 fi
1476
1477 for ac_hdr in getopt.h
1478 do
1479 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1480 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1481 echo "configure:1482: checking for $ac_hdr" >&5
1482 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1483   echo $ac_n "(cached) $ac_c" 1>&6
1484 else
1485   cat > conftest.$ac_ext <<EOF
1486 #line 1487 "configure"
1487 #include "confdefs.h"
1488 #include <$ac_hdr>
1489 EOF
1490 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1491 { (eval echo configure:1492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1492 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1493 if test -z "$ac_err"; then
1494   rm -rf conftest*
1495   eval "ac_cv_header_$ac_safe=yes"
1496 else
1497   echo "$ac_err" >&5
1498   echo "configure: failed program was:" >&5
1499   cat conftest.$ac_ext >&5
1500   rm -rf conftest*
1501   eval "ac_cv_header_$ac_safe=no"
1502 fi
1503 rm -f conftest*
1504 fi
1505 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1506   echo "$ac_t""yes" 1>&6
1507     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1508   cat >> confdefs.h <<EOF
1509 #define $ac_tr_hdr 1
1510 EOF
1511  
1512 else
1513   echo "$ac_t""no" 1>&6
1514 fi
1515 done
1516
1517 for ac_hdr in unistd.h
1518 do
1519 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1520 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1521 echo "configure:1522: checking for $ac_hdr" >&5
1522 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1523   echo $ac_n "(cached) $ac_c" 1>&6
1524 else
1525   cat > conftest.$ac_ext <<EOF
1526 #line 1527 "configure"
1527 #include "confdefs.h"
1528 #include <$ac_hdr>
1529 EOF
1530 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1531 { (eval echo configure:1532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1532 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1533 if test -z "$ac_err"; then
1534   rm -rf conftest*
1535   eval "ac_cv_header_$ac_safe=yes"
1536 else
1537   echo "$ac_err" >&5
1538   echo "configure: failed program was:" >&5
1539   cat conftest.$ac_ext >&5
1540   rm -rf conftest*
1541   eval "ac_cv_header_$ac_safe=no"
1542 fi
1543 rm -f conftest*
1544 fi
1545 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1546   echo "$ac_t""yes" 1>&6
1547     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1548   cat >> confdefs.h <<EOF
1549 #define $ac_tr_hdr 1
1550 EOF
1551  
1552 else
1553   echo "$ac_t""no" 1>&6
1554 fi
1555 done
1556
1557 for ac_hdr in endian.h
1558 do
1559 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1560 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1561 echo "configure:1562: checking for $ac_hdr" >&5
1562 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1563   echo $ac_n "(cached) $ac_c" 1>&6
1564 else
1565   cat > conftest.$ac_ext <<EOF
1566 #line 1567 "configure"
1567 #include "confdefs.h"
1568 #include <$ac_hdr>
1569 EOF
1570 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1571 { (eval echo configure:1572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1572 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1573 if test -z "$ac_err"; then
1574   rm -rf conftest*
1575   eval "ac_cv_header_$ac_safe=yes"
1576 else
1577   echo "$ac_err" >&5
1578   echo "configure: failed program was:" >&5
1579   cat conftest.$ac_ext >&5
1580   rm -rf conftest*
1581   eval "ac_cv_header_$ac_safe=no"
1582 fi
1583 rm -f conftest*
1584 fi
1585 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1586   echo "$ac_t""yes" 1>&6
1587     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1588   cat >> confdefs.h <<EOF
1589 #define $ac_tr_hdr 1
1590 EOF
1591  
1592 else
1593   echo "$ac_t""no" 1>&6
1594 fi
1595 done
1596
1597 for ac_hdr in sys/isa_defs.h
1598 do
1599 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1600 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1601 echo "configure:1602: checking for $ac_hdr" >&5
1602 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1603   echo $ac_n "(cached) $ac_c" 1>&6
1604 else
1605   cat > conftest.$ac_ext <<EOF
1606 #line 1607 "configure"
1607 #include "confdefs.h"
1608 #include <$ac_hdr>
1609 EOF
1610 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1611 { (eval echo configure:1612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1612 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1613 if test -z "$ac_err"; then
1614   rm -rf conftest*
1615   eval "ac_cv_header_$ac_safe=yes"
1616 else
1617   echo "$ac_err" >&5
1618   echo "configure: failed program was:" >&5
1619   cat conftest.$ac_ext >&5
1620   rm -rf conftest*
1621   eval "ac_cv_header_$ac_safe=no"
1622 fi
1623 rm -f conftest*
1624 fi
1625 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1626   echo "$ac_t""yes" 1>&6
1627     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1628   cat >> confdefs.h <<EOF
1629 #define $ac_tr_hdr 1
1630 EOF
1631  
1632 else
1633   echo "$ac_t""no" 1>&6
1634 fi
1635 done
1636
1637 for ac_hdr in sys/socket.h
1638 do
1639 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1640 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1641 echo "configure:1642: checking for $ac_hdr" >&5
1642 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1643   echo $ac_n "(cached) $ac_c" 1>&6
1644 else
1645   cat > conftest.$ac_ext <<EOF
1646 #line 1647 "configure"
1647 #include "confdefs.h"
1648 #include <$ac_hdr>
1649 EOF
1650 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1651 { (eval echo configure:1652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1652 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1653 if test -z "$ac_err"; then
1654   rm -rf conftest*
1655   eval "ac_cv_header_$ac_safe=yes"
1656 else
1657   echo "$ac_err" >&5
1658   echo "configure: failed program was:" >&5
1659   cat conftest.$ac_ext >&5
1660   rm -rf conftest*
1661   eval "ac_cv_header_$ac_safe=no"
1662 fi
1663 rm -f conftest*
1664 fi
1665 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1666   echo "$ac_t""yes" 1>&6
1667     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1668   cat >> confdefs.h <<EOF
1669 #define $ac_tr_hdr 1
1670 EOF
1671  
1672 else
1673   echo "$ac_t""no" 1>&6
1674 fi
1675 done
1676
1677 ac_header_dirent=no
1678 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1679 do
1680 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1681 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1682 echo "configure:1683: checking for $ac_hdr that defines DIR" >&5
1683 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1684   echo $ac_n "(cached) $ac_c" 1>&6
1685 else
1686   cat > conftest.$ac_ext <<EOF
1687 #line 1688 "configure"
1688 #include "confdefs.h"
1689 #include <sys/types.h>
1690 #include <$ac_hdr>
1691 int main() {
1692 DIR *dirp = 0;
1693 ; return 0; }
1694 EOF
1695 if { (eval echo configure:1696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1696   rm -rf conftest*
1697   eval "ac_cv_header_dirent_$ac_safe=yes"
1698 else
1699   echo "configure: failed program was:" >&5
1700   cat conftest.$ac_ext >&5
1701   rm -rf conftest*
1702   eval "ac_cv_header_dirent_$ac_safe=no"
1703 fi
1704 rm -f conftest*
1705 fi
1706 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1707   echo "$ac_t""yes" 1>&6
1708     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1709   cat >> confdefs.h <<EOF
1710 #define $ac_tr_hdr 1
1711 EOF
1712  ac_header_dirent=$ac_hdr; break
1713 else
1714   echo "$ac_t""no" 1>&6
1715 fi
1716 done
1717 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1718 if test $ac_header_dirent = dirent.h; then
1719 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1720 echo "configure:1721: checking for opendir in -ldir" >&5
1721 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1722 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1723   echo $ac_n "(cached) $ac_c" 1>&6
1724 else
1725   ac_save_LIBS="$LIBS"
1726 LIBS="-ldir  $LIBS"
1727 cat > conftest.$ac_ext <<EOF
1728 #line 1729 "configure"
1729 #include "confdefs.h"
1730 /* Override any gcc2 internal prototype to avoid an error.  */
1731 /* We use char because int might match the return type of a gcc2
1732     builtin and then its argument prototype would still apply.  */
1733 char opendir();
1734
1735 int main() {
1736 opendir()
1737 ; return 0; }
1738 EOF
1739 if { (eval echo configure:1740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1740   rm -rf conftest*
1741   eval "ac_cv_lib_$ac_lib_var=yes"
1742 else
1743   echo "configure: failed program was:" >&5
1744   cat conftest.$ac_ext >&5
1745   rm -rf conftest*
1746   eval "ac_cv_lib_$ac_lib_var=no"
1747 fi
1748 rm -f conftest*
1749 LIBS="$ac_save_LIBS"
1750
1751 fi
1752 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1753   echo "$ac_t""yes" 1>&6
1754   LIBS="$LIBS -ldir"
1755 else
1756   echo "$ac_t""no" 1>&6
1757 fi
1758
1759 else
1760 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1761 echo "configure:1762: checking for opendir in -lx" >&5
1762 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1763 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1764   echo $ac_n "(cached) $ac_c" 1>&6
1765 else
1766   ac_save_LIBS="$LIBS"
1767 LIBS="-lx  $LIBS"
1768 cat > conftest.$ac_ext <<EOF
1769 #line 1770 "configure"
1770 #include "confdefs.h"
1771 /* Override any gcc2 internal prototype to avoid an error.  */
1772 /* We use char because int might match the return type of a gcc2
1773     builtin and then its argument prototype would still apply.  */
1774 char opendir();
1775
1776 int main() {
1777 opendir()
1778 ; return 0; }
1779 EOF
1780 if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1781   rm -rf conftest*
1782   eval "ac_cv_lib_$ac_lib_var=yes"
1783 else
1784   echo "configure: failed program was:" >&5
1785   cat conftest.$ac_ext >&5
1786   rm -rf conftest*
1787   eval "ac_cv_lib_$ac_lib_var=no"
1788 fi
1789 rm -f conftest*
1790 LIBS="$ac_save_LIBS"
1791
1792 fi
1793 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1794   echo "$ac_t""yes" 1>&6
1795   LIBS="$LIBS -lx"
1796 else
1797   echo "$ac_t""no" 1>&6
1798 fi
1799
1800 fi
1801
1802
1803 # This must be after CPP
1804
1805 echo $ac_n "checking which header file defines FD_ macros""... $ac_c" 1>&6
1806 echo "configure:1807: checking which header file defines FD_ macros" >&5
1807 if eval "test \"`echo '$''{'s51_cv_fd'+set}'`\" = set"; then
1808   echo $ac_n "(cached) $ac_c" 1>&6
1809 else
1810   sdcc_cv_fd="unknown"
1811 cat > conftest.$ac_ext <<EOF
1812 #line 1813 "configure"
1813 #include "confdefs.h"
1814
1815 #include <sys/time.h>
1816 #ifdef FD_ZERO
1817 yes
1818 #endif
1819 EOF
1820 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1821   egrep "yes" >/dev/null 2>&1; then
1822   rm -rf conftest*
1823   sdcc_cv_fd="<sys/time.h>"
1824 fi
1825 rm -f conftest*
1826
1827 cat > conftest.$ac_ext <<EOF
1828 #line 1829 "configure"
1829 #include "confdefs.h"
1830
1831 #include <sys/types.h>
1832 #ifdef FD_ZERO
1833 yes
1834 #endif
1835 EOF
1836 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1837   egrep "yes" >/dev/null 2>&1; then
1838   rm -rf conftest*
1839   sdcc_cv_fd="<sys/types.h>"
1840 fi
1841 rm -f conftest*
1842
1843 cat > conftest.$ac_ext <<EOF
1844 #line 1845 "configure"
1845 #include "confdefs.h"
1846
1847 #include <sys/select.h>
1848 #ifdef FD_ZERO
1849 yes
1850 #endif
1851 EOF
1852 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1853   egrep "yes" >/dev/null 2>&1; then
1854   rm -rf conftest*
1855   sdcc_cv_fd="<sys/types.h>"
1856 fi
1857 rm -f conftest*
1858
1859 fi
1860
1861 echo "$ac_t""$s51_cv_fd" 1>&6
1862
1863 cat >> confdefs.h <<\EOF
1864 #define FD_HEADER_OK 0
1865 EOF
1866
1867 if echo $sdcc_cv_fd|grep time >/dev/null 2>&1; then
1868 cat >> confdefs.h <<\EOF
1869 #define FD_NEED_TIME_H 1
1870 EOF
1871
1872 cat >> confdefs.h <<\EOF
1873 #define FD_HEADER_OK 1
1874 EOF
1875
1876 else
1877 cat >> confdefs.h <<\EOF
1878 #define FD_NEED_TIME_H 0
1879 EOF
1880
1881 fi
1882 if echo $sdcc_cv_fd|grep types >/dev/null 2>&1; then
1883 cat >> confdefs.h <<\EOF
1884 #define FD_NEED_TYPES_H 1
1885 EOF
1886
1887 cat >> confdefs.h <<\EOF
1888 #define FD_HEADER_OK 1
1889 EOF
1890
1891 else
1892 cat >> confdefs.h <<\EOF
1893 #define FD_NEED_TYPES_H 0
1894 EOF
1895
1896 fi
1897 if echo $sdcc_cv_fd|grep select >/dev/null 2>&1; then
1898 cat >> confdefs.h <<\EOF
1899 #define FD_NEED_SELECT_H 1
1900 EOF
1901
1902 cat >> confdefs.h <<\EOF
1903 #define FD_HEADER_OK 1
1904 EOF
1905
1906 else
1907 cat >> confdefs.h <<\EOF
1908 #define FD_NEED_SELECT_H 0
1909 EOF
1910
1911 fi
1912
1913 cat >> confdefs.h <<EOF
1914 #define HEADER_FD ${sdcc_cv_fd}
1915 EOF
1916
1917
1918
1919 # Checking for functions
1920 # ===========================================================================
1921 for ac_func in strlen strcpy strcat strstr strcmp strerror strtok strdup
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 /* We use char because int might match the return type of a gcc2
1936     builtin and then its argument prototype would still apply.  */
1937 char $ac_func();
1938
1939 int main() {
1940
1941 /* The GNU C library defines this for functions which it implements
1942     to always fail with ENOSYS.  Some functions are actually named
1943     something starting with __ and the normal name is an alias.  */
1944 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1945 choke me
1946 #else
1947 $ac_func();
1948 #endif
1949
1950 ; return 0; }
1951 EOF
1952 if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1953   rm -rf conftest*
1954   eval "ac_cv_func_$ac_func=yes"
1955 else
1956   echo "configure: failed program was:" >&5
1957   cat conftest.$ac_ext >&5
1958   rm -rf conftest*
1959   eval "ac_cv_func_$ac_func=no"
1960 fi
1961 rm -f conftest*
1962 fi
1963
1964 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1965   echo "$ac_t""yes" 1>&6
1966     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1967   cat >> confdefs.h <<EOF
1968 #define $ac_tr_func 1
1969 EOF
1970  
1971 else
1972   echo "$ac_t""no" 1>&6
1973 fi
1974 done
1975
1976 for ac_func in strchr memcpy
1977 do
1978 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1979 echo "configure:1980: checking for $ac_func" >&5
1980 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1981   echo $ac_n "(cached) $ac_c" 1>&6
1982 else
1983   cat > conftest.$ac_ext <<EOF
1984 #line 1985 "configure"
1985 #include "confdefs.h"
1986 /* System header to define __stub macros and hopefully few prototypes,
1987     which can conflict with char $ac_func(); below.  */
1988 #include <assert.h>
1989 /* Override any gcc2 internal prototype to avoid an error.  */
1990 /* We use char because int might match the return type of a gcc2
1991     builtin and then its argument prototype would still apply.  */
1992 char $ac_func();
1993
1994 int main() {
1995
1996 /* The GNU C library defines this for functions which it implements
1997     to always fail with ENOSYS.  Some functions are actually named
1998     something starting with __ and the normal name is an alias.  */
1999 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2000 choke me
2001 #else
2002 $ac_func();
2003 #endif
2004
2005 ; return 0; }
2006 EOF
2007 if { (eval echo configure:2008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2008   rm -rf conftest*
2009   eval "ac_cv_func_$ac_func=yes"
2010 else
2011   echo "configure: failed program was:" >&5
2012   cat conftest.$ac_ext >&5
2013   rm -rf conftest*
2014   eval "ac_cv_func_$ac_func=no"
2015 fi
2016 rm -f conftest*
2017 fi
2018
2019 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2020   echo "$ac_t""yes" 1>&6
2021     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2022   cat >> confdefs.h <<EOF
2023 #define $ac_tr_func 1
2024 EOF
2025  
2026 else
2027   echo "$ac_t""no" 1>&6
2028 fi
2029 done
2030
2031 for ac_func in fgets
2032 do
2033 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2034 echo "configure:2035: checking for $ac_func" >&5
2035 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2036   echo $ac_n "(cached) $ac_c" 1>&6
2037 else
2038   cat > conftest.$ac_ext <<EOF
2039 #line 2040 "configure"
2040 #include "confdefs.h"
2041 /* System header to define __stub macros and hopefully few prototypes,
2042     which can conflict with char $ac_func(); below.  */
2043 #include <assert.h>
2044 /* Override any gcc2 internal prototype to avoid an error.  */
2045 /* We use char because int might match the return type of a gcc2
2046     builtin and then its argument prototype would still apply.  */
2047 char $ac_func();
2048
2049 int main() {
2050
2051 /* The GNU C library defines this for functions which it implements
2052     to always fail with ENOSYS.  Some functions are actually named
2053     something starting with __ and the normal name is an alias.  */
2054 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2055 choke me
2056 #else
2057 $ac_func();
2058 #endif
2059
2060 ; return 0; }
2061 EOF
2062 if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2063   rm -rf conftest*
2064   eval "ac_cv_func_$ac_func=yes"
2065 else
2066   echo "configure: failed program was:" >&5
2067   cat conftest.$ac_ext >&5
2068   rm -rf conftest*
2069   eval "ac_cv_func_$ac_func=no"
2070 fi
2071 rm -f conftest*
2072 fi
2073
2074 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2075   echo "$ac_t""yes" 1>&6
2076     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2077   cat >> confdefs.h <<EOF
2078 #define $ac_tr_func 1
2079 EOF
2080  
2081 else
2082   echo "$ac_t""no" 1>&6
2083 fi
2084 done
2085
2086 for ac_func in yylex
2087 do
2088 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2089 echo "configure:2090: checking for $ac_func" >&5
2090 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2091   echo $ac_n "(cached) $ac_c" 1>&6
2092 else
2093   cat > conftest.$ac_ext <<EOF
2094 #line 2095 "configure"
2095 #include "confdefs.h"
2096 /* System header to define __stub macros and hopefully few prototypes,
2097     which can conflict with char $ac_func(); below.  */
2098 #include <assert.h>
2099 /* Override any gcc2 internal prototype to avoid an error.  */
2100 /* We use char because int might match the return type of a gcc2
2101     builtin and then its argument prototype would still apply.  */
2102 char $ac_func();
2103
2104 int main() {
2105
2106 /* The GNU C library defines this for functions which it implements
2107     to always fail with ENOSYS.  Some functions are actually named
2108     something starting with __ and the normal name is an alias.  */
2109 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2110 choke me
2111 #else
2112 $ac_func();
2113 #endif
2114
2115 ; return 0; }
2116 EOF
2117 if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2118   rm -rf conftest*
2119   eval "ac_cv_func_$ac_func=yes"
2120 else
2121   echo "configure: failed program was:" >&5
2122   cat conftest.$ac_ext >&5
2123   rm -rf conftest*
2124   eval "ac_cv_func_$ac_func=no"
2125 fi
2126 rm -f conftest*
2127 fi
2128
2129 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2130   echo "$ac_t""yes" 1>&6
2131     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2132   cat >> confdefs.h <<EOF
2133 #define $ac_tr_func 1
2134 EOF
2135  
2136 else
2137   echo "$ac_t""no" 1>&6
2138 fi
2139 done
2140
2141
2142 # check if -lsocket && -lxnet is required to compile socket stuff
2143
2144 echo $ac_n "checking for library containing socket""... $ac_c" 1>&6
2145 echo "configure:2146: checking for library containing socket" >&5
2146 if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then
2147   echo $ac_n "(cached) $ac_c" 1>&6
2148 else
2149   ac_func_search_save_LIBS="$LIBS"
2150 ac_cv_search_socket="no"
2151 cat > conftest.$ac_ext <<EOF
2152 #line 2153 "configure"
2153 #include "confdefs.h"
2154 /* Override any gcc2 internal prototype to avoid an error.  */
2155 /* We use char because int might match the return type of a gcc2
2156     builtin and then its argument prototype would still apply.  */
2157 char socket();
2158
2159 int main() {
2160 socket()
2161 ; return 0; }
2162 EOF
2163 if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2164   rm -rf conftest*
2165   ac_cv_search_socket="none required"
2166 else
2167   echo "configure: failed program was:" >&5
2168   cat conftest.$ac_ext >&5
2169 fi
2170 rm -f conftest*
2171 test "$ac_cv_search_socket" = "no" && for i in socket; do
2172 LIBS="-l$i  $ac_func_search_save_LIBS"
2173 cat > conftest.$ac_ext <<EOF
2174 #line 2175 "configure"
2175 #include "confdefs.h"
2176 /* Override any gcc2 internal prototype to avoid an error.  */
2177 /* We use char because int might match the return type of a gcc2
2178     builtin and then its argument prototype would still apply.  */
2179 char socket();
2180
2181 int main() {
2182 socket()
2183 ; return 0; }
2184 EOF
2185 if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2186   rm -rf conftest*
2187   ac_cv_search_socket="-l$i"
2188 break
2189 else
2190   echo "configure: failed program was:" >&5
2191   cat conftest.$ac_ext >&5
2192 fi
2193 rm -f conftest*
2194 done
2195 LIBS="$ac_func_search_save_LIBS"
2196 fi
2197
2198 echo "$ac_t""$ac_cv_search_socket" 1>&6
2199 if test "$ac_cv_search_socket" != "no"; then
2200   test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS"
2201   
2202 else :
2203   
2204 fi
2205
2206 echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6
2207 echo "configure:2208: checking for library containing inet_addr" >&5
2208 if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then
2209   echo $ac_n "(cached) $ac_c" 1>&6
2210 else
2211   ac_func_search_save_LIBS="$LIBS"
2212 ac_cv_search_inet_addr="no"
2213 cat > conftest.$ac_ext <<EOF
2214 #line 2215 "configure"
2215 #include "confdefs.h"
2216 /* Override any gcc2 internal prototype to avoid an error.  */
2217 /* We use char because int might match the return type of a gcc2
2218     builtin and then its argument prototype would still apply.  */
2219 char inet_addr();
2220
2221 int main() {
2222 inet_addr()
2223 ; return 0; }
2224 EOF
2225 if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2226   rm -rf conftest*
2227   ac_cv_search_inet_addr="none required"
2228 else
2229   echo "configure: failed program was:" >&5
2230   cat conftest.$ac_ext >&5
2231 fi
2232 rm -f conftest*
2233 test "$ac_cv_search_inet_addr" = "no" && for i in nsl xnet; do
2234 LIBS="-l$i  $ac_func_search_save_LIBS"
2235 cat > conftest.$ac_ext <<EOF
2236 #line 2237 "configure"
2237 #include "confdefs.h"
2238 /* Override any gcc2 internal prototype to avoid an error.  */
2239 /* We use char because int might match the return type of a gcc2
2240     builtin and then its argument prototype would still apply.  */
2241 char inet_addr();
2242
2243 int main() {
2244 inet_addr()
2245 ; return 0; }
2246 EOF
2247 if { (eval echo configure:2248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2248   rm -rf conftest*
2249   ac_cv_search_inet_addr="-l$i"
2250 break
2251 else
2252   echo "configure: failed program was:" >&5
2253   cat conftest.$ac_ext >&5
2254 fi
2255 rm -f conftest*
2256 done
2257 LIBS="$ac_func_search_save_LIBS"
2258 fi
2259
2260 echo "$ac_t""$ac_cv_search_inet_addr" 1>&6
2261 if test "$ac_cv_search_inet_addr" != "no"; then
2262   test "$ac_cv_search_inet_addr" = "none required" || LIBS="$ac_cv_search_inet_addr $LIBS"
2263   
2264 else :
2265   
2266 fi
2267
2268 # Macro definitions
2269 ###################
2270
2271 # DD_COPT macro checks if the compiler specified as the 1st parameter
2272 # supports option specified as the 2nd parameter
2273 # For example: DD_CPORT(CXX, fPIC)
2274
2275
2276
2277
2278 # Checking characteristics of compilers and other programs
2279 # --------------------------------------------------------
2280 echo $ac_n "checking whether preprocessor accepts -MM or -M""... $ac_c" 1>&6
2281 echo "configure:2282: checking whether preprocessor accepts -MM or -M" >&5
2282 if eval "test \"`echo '$''{'sdcc_cv_MM'+set}'`\" = set"; then
2283   echo $ac_n "(cached) $ac_c" 1>&6
2284 else
2285   echo "#include <stdio.h>" >_test_.c
2286 echo "" >>_test_.c
2287 $CPP -v -MM _test_.c 1>&5 2>&5
2288 if test "$?" = "0"; then
2289   sdcc_cv_MM="-MM"
2290 else
2291   sdcc_cv_MM="-M"
2292 fi
2293 rm -f _test_.*
2294 fi
2295
2296 echo "$ac_t""$sdcc_cv_MM" 1>&6
2297 M_OR_MM=$sdcc_cv_MM
2298
2299
2300 # This is the first time when CFLAGS are set/modified!!
2301
2302 echo $ac_n "checking whether $CC accepts -ggdb""... $ac_c" 1>&6
2303 echo "configure:2304: checking whether $CC accepts -ggdb" >&5
2304 if eval "test \"`echo '$''{'sdcc_cv_CCggdb'+set}'`\" = set"; then
2305   echo $ac_n "(cached) $ac_c" 1>&6
2306 else
2307   cat >_test_.c <<EOF
2308 #include <stdio.h>
2309 void main(void) {}
2310 EOF
2311 $CC -v -ggdb -c _test_.c 1>&5 2>&5
2312 if test "$?" = "0"; then
2313   sdcc_cv_CCggdb="yes"
2314 else
2315   sdcc_cv_CCggdb="no"
2316 fi
2317 rm -f _test_.* a.out
2318 fi
2319
2320 echo "$ac_t""$sdcc_cv_CCggdb" 1>&6
2321
2322 if test "$sdcc_cv_CCggdb" = "yes"; then
2323   CFLAGS="-ggdb -O2"
2324 fi
2325
2326
2327 echo $ac_n "checking whether $CC accepts -pipe""... $ac_c" 1>&6
2328 echo "configure:2329: checking whether $CC accepts -pipe" >&5
2329 if eval "test \"`echo '$''{'sdcc_cv_CCpipe'+set}'`\" = set"; then
2330   echo $ac_n "(cached) $ac_c" 1>&6
2331 else
2332   cat >_test_.c <<EOF
2333 #include <stdio.h>
2334 void main(void) {}
2335 EOF
2336 $CC -v -pipe -c _test_.c 1>&5 2>&5
2337 if test "$?" = "0"; then
2338   sdcc_cv_CCpipe="yes"
2339 else
2340   sdcc_cv_CCpipe="no"
2341 fi
2342 rm -f _test_.* a.out
2343 fi
2344
2345 echo "$ac_t""$sdcc_cv_CCpipe" 1>&6
2346
2347 if test "$sdcc_cv_CCpipe" = "yes"; then
2348   CFLAGS="$CFLAGS -pipe"
2349 fi
2350
2351
2352 # Checks for typedefs, structures, and compiler characteristics.
2353 # ===========================================================================
2354 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
2355 echo "configure:2356: checking return type of signal handlers" >&5
2356 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
2357   echo $ac_n "(cached) $ac_c" 1>&6
2358 else
2359   cat > conftest.$ac_ext <<EOF
2360 #line 2361 "configure"
2361 #include "confdefs.h"
2362 #include <sys/types.h>
2363 #include <signal.h>
2364 #ifdef signal
2365 #undef signal
2366 #endif
2367 #ifdef __cplusplus
2368 extern "C" void (*signal (int, void (*)(int)))(int);
2369 #else
2370 void (*signal ()) ();
2371 #endif
2372
2373 int main() {
2374 int i;
2375 ; return 0; }
2376 EOF
2377 if { (eval echo configure:2378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2378   rm -rf conftest*
2379   ac_cv_type_signal=void
2380 else
2381   echo "configure: failed program was:" >&5
2382   cat conftest.$ac_ext >&5
2383   rm -rf conftest*
2384   ac_cv_type_signal=int
2385 fi
2386 rm -f conftest*
2387 fi
2388
2389 echo "$ac_t""$ac_cv_type_signal" 1>&6
2390 cat >> confdefs.h <<EOF
2391 #define RETSIGTYPE $ac_cv_type_signal
2392 EOF
2393
2394
2395
2396 #
2397 #
2398 if test "${prefix}" = "NONE"; then
2399     prefix="/usr/local"
2400 fi
2401
2402 config_in=`pwd`
2403 if test "${datadir}" = "\${prefix}/share"; then
2404   sdcc_datadir=${prefix}/share
2405 else
2406   sdcc_datadir=${datadir}
2407 fi
2408 cat >> confdefs.h <<EOF
2409 #define STANDARD_INCLUDE_DIR "${sdcc_datadir}/include"
2410 EOF
2411
2412 cat >> confdefs.h <<EOF
2413 #define SDCC_INCLUDE_DIR "${sdcc_datadir}/include"
2414 EOF
2415
2416 cat >> confdefs.h <<EOF
2417 #define SDCC_LIB_DIR "${sdcc_datadir}/lib"
2418 EOF
2419
2420 cat >> confdefs.h <<EOF
2421 #define STD_LIB "libsdcc"
2422 EOF
2423
2424 cat >> confdefs.h <<EOF
2425 #define STD_INT_LIB "libint"
2426 EOF
2427
2428 cat >> confdefs.h <<EOF
2429 #define STD_LONG_LIB "liblong"
2430 EOF
2431
2432 cat >> confdefs.h <<EOF
2433 #define STD_FP_LIB "libfloat"
2434 EOF
2435
2436
2437 cat >> confdefs.h <<EOF
2438 #define PREFIX "${prefix}"
2439 EOF
2440
2441 cat >> confdefs.h <<EOF
2442 #define DATADIR "${sdcc_datadir}"
2443 EOF
2444
2445 cat >> confdefs.h <<EOF
2446 #define SRCDIR "${config_in}"
2447 EOF
2448
2449
2450 # mlh: dont compile libgc if it's available locally
2451 echo $ac_n "checking for GC_malloc in -lgc""... $ac_c" 1>&6
2452 echo "configure:2453: checking for GC_malloc in -lgc" >&5
2453 ac_lib_var=`echo gc'_'GC_malloc | sed 'y%./+-%__p_%'`
2454 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2455   echo $ac_n "(cached) $ac_c" 1>&6
2456 else
2457   ac_save_LIBS="$LIBS"
2458 LIBS="-lgc  $LIBS"
2459 cat > conftest.$ac_ext <<EOF
2460 #line 2461 "configure"
2461 #include "confdefs.h"
2462 /* Override any gcc2 internal prototype to avoid an error.  */
2463 /* We use char because int might match the return type of a gcc2
2464     builtin and then its argument prototype would still apply.  */
2465 char GC_malloc();
2466
2467 int main() {
2468 GC_malloc()
2469 ; return 0; }
2470 EOF
2471 if { (eval echo configure:2472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2472   rm -rf conftest*
2473   eval "ac_cv_lib_$ac_lib_var=yes"
2474 else
2475   echo "configure: failed program was:" >&5
2476   cat conftest.$ac_ext >&5
2477   rm -rf conftest*
2478   eval "ac_cv_lib_$ac_lib_var=no"
2479 fi
2480 rm -f conftest*
2481 LIBS="$ac_save_LIBS"
2482
2483 fi
2484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2485   echo "$ac_t""yes" 1>&6
2486   HAVE_LIBGC=1
2487 else
2488   echo "$ac_t""no" 1>&6
2489 fi
2490
2491
2492
2493 # Generating output files
2494 # ===========================================================================
2495 subdirs="sim/ucsim"
2496
2497 trap '' 1 2 15
2498 cat > confcache <<\EOF
2499 # This file is a shell script that caches the results of configure
2500 # tests run on this system so they can be shared between configure
2501 # scripts and configure runs.  It is not useful on other systems.
2502 # If it contains results you don't want to keep, you may remove or edit it.
2503 #
2504 # By default, configure uses ./config.cache as the cache file,
2505 # creating it if it does not exist already.  You can give configure
2506 # the --cache-file=FILE option to use a different cache file; that is
2507 # what configure does when it calls configure scripts in
2508 # subdirectories, so they share the cache.
2509 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2510 # config.status only pays attention to the cache file if you give it the
2511 # --recheck option to rerun configure.
2512 #
2513 EOF
2514 # The following way of writing the cache mishandles newlines in values,
2515 # but we know of no workaround that is simple, portable, and efficient.
2516 # So, don't put newlines in cache variables' values.
2517 # Ultrix sh set writes to stderr and can't be redirected directly,
2518 # and sets the high bit in the cache file unless we assign to the vars.
2519 (set) 2>&1 |
2520   case `(ac_space=' '; set | grep ac_space) 2>&1` in
2521   *ac_space=\ *)
2522     # `set' does not quote correctly, so add quotes (double-quote substitution
2523     # turns \\\\ into \\, and sed turns \\ into \).
2524     sed -n \
2525       -e "s/'/'\\\\''/g" \
2526       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2527     ;;
2528   *)
2529     # `set' quotes correctly as required by POSIX, so do not add quotes.
2530     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2531     ;;
2532   esac >> confcache
2533 if cmp -s $cache_file confcache; then
2534   :
2535 else
2536   if test -w $cache_file; then
2537     echo "updating cache $cache_file"
2538     cat confcache > $cache_file
2539   else
2540     echo "not updating unwritable cache $cache_file"
2541   fi
2542 fi
2543 rm -f confcache
2544
2545 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2546
2547 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2548 # Let make expand exec_prefix.
2549 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2550
2551 # Any assignment to VPATH causes Sun make to only execute
2552 # the first set of double-colon rules, so remove it if not needed.
2553 # If there is a colon in the path, we need to keep it.
2554 if test "x$srcdir" = x.; then
2555   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2556 fi
2557
2558 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2559
2560 DEFS=-DHAVE_CONFIG_H
2561
2562 # Without the "./", some shells look in PATH for config.status.
2563 : ${CONFIG_STATUS=./config.status}
2564
2565 echo creating $CONFIG_STATUS
2566 rm -f $CONFIG_STATUS
2567 cat > $CONFIG_STATUS <<EOF
2568 #! /bin/sh
2569 # Generated automatically by configure.
2570 # Run this file to recreate the current configuration.
2571 # This directory was configured as follows,
2572 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2573 #
2574 # $0 $ac_configure_args
2575 #
2576 # Compiler output produced by configure, useful for debugging
2577 # configure, is in ./config.log if it exists.
2578
2579 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2580 for ac_option
2581 do
2582   case "\$ac_option" in
2583   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2584     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2585     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2586   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2587     echo "$CONFIG_STATUS generated by autoconf version 2.13"
2588     exit 0 ;;
2589   -help | --help | --hel | --he | --h)
2590     echo "\$ac_cs_usage"; exit 0 ;;
2591   *) echo "\$ac_cs_usage"; exit 1 ;;
2592   esac
2593 done
2594
2595 ac_given_srcdir=$srcdir
2596 ac_given_INSTALL="$INSTALL"
2597
2598 trap 'rm -fr `echo "main.mk:main_in.mk
2599 support/gc/Makefile
2600 src/Makefile
2601 as/mcs51/Makefile
2602 as/z80/Makefile
2603 link/z80/Makefile
2604 support/cpp/Makefile
2605 device/include/Makefile
2606 device/lib/Makefile
2607 debugger/mcs51/Makefile
2608 Makefile.common:Makefile.common.in
2609  sdccconf.h:sdccconf_in.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2610 EOF
2611 cat >> $CONFIG_STATUS <<EOF
2612
2613 # Protect against being on the right side of a sed subst in config.status.
2614 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2615  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2616 $ac_vpsub
2617 $extrasub
2618 s%@SHELL@%$SHELL%g
2619 s%@CFLAGS@%$CFLAGS%g
2620 s%@CPPFLAGS@%$CPPFLAGS%g
2621 s%@CXXFLAGS@%$CXXFLAGS%g
2622 s%@FFLAGS@%$FFLAGS%g
2623 s%@DEFS@%$DEFS%g
2624 s%@LDFLAGS@%$LDFLAGS%g
2625 s%@LIBS@%$LIBS%g
2626 s%@exec_prefix@%$exec_prefix%g
2627 s%@prefix@%$prefix%g
2628 s%@program_transform_name@%$program_transform_name%g
2629 s%@bindir@%$bindir%g
2630 s%@sbindir@%$sbindir%g
2631 s%@libexecdir@%$libexecdir%g
2632 s%@datadir@%$datadir%g
2633 s%@sysconfdir@%$sysconfdir%g
2634 s%@sharedstatedir@%$sharedstatedir%g
2635 s%@localstatedir@%$localstatedir%g
2636 s%@libdir@%$libdir%g
2637 s%@includedir@%$includedir%g
2638 s%@oldincludedir@%$oldincludedir%g
2639 s%@infodir@%$infodir%g
2640 s%@mandir@%$mandir%g
2641 s%@AWK@%$AWK%g
2642 s%@VERSION@%$VERSION%g
2643 s%@VERSIONHI@%$VERSIONHI%g
2644 s%@VERSIONLO@%$VERSIONLO%g
2645 s%@VERSIONP@%$VERSIONP%g
2646 s%@CC@%$CC%g
2647 s%@CXX@%$CXX%g
2648 s%@CPP@%$CPP%g
2649 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2650 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
2651 s%@INSTALL_DATA@%$INSTALL_DATA%g
2652 s%@RANLIB@%$RANLIB%g
2653 s%@YACC@%$YACC%g
2654 s%@LEX@%$LEX%g
2655 s%@LEXLIB@%$LEXLIB%g
2656 s%@AUTOCONF@%$AUTOCONF%g
2657 s%@AS@%$AS%g
2658 s%@CP@%$CP%g
2659 s%@M_OR_MM@%$M_OR_MM%g
2660 s%@HAVE_LIBGC@%$HAVE_LIBGC%g
2661 s%@subdirs@%$subdirs%g
2662
2663 CEOF
2664 EOF
2665
2666 cat >> $CONFIG_STATUS <<\EOF
2667
2668 # Split the substitutions into bite-sized pieces for seds with
2669 # small command number limits, like on Digital OSF/1 and HP-UX.
2670 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2671 ac_file=1 # Number of current file.
2672 ac_beg=1 # First line for current file.
2673 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2674 ac_more_lines=:
2675 ac_sed_cmds=""
2676 while $ac_more_lines; do
2677   if test $ac_beg -gt 1; then
2678     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2679   else
2680     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2681   fi
2682   if test ! -s conftest.s$ac_file; then
2683     ac_more_lines=false
2684     rm -f conftest.s$ac_file
2685   else
2686     if test -z "$ac_sed_cmds"; then
2687       ac_sed_cmds="sed -f conftest.s$ac_file"
2688     else
2689       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2690     fi
2691     ac_file=`expr $ac_file + 1`
2692     ac_beg=$ac_end
2693     ac_end=`expr $ac_end + $ac_max_sed_cmds`
2694   fi
2695 done
2696 if test -z "$ac_sed_cmds"; then
2697   ac_sed_cmds=cat
2698 fi
2699 EOF
2700
2701 cat >> $CONFIG_STATUS <<EOF
2702
2703 CONFIG_FILES=\${CONFIG_FILES-"main.mk:main_in.mk
2704 support/gc/Makefile
2705 src/Makefile
2706 as/mcs51/Makefile
2707 as/z80/Makefile
2708 link/z80/Makefile
2709 support/cpp/Makefile
2710 device/include/Makefile
2711 device/lib/Makefile
2712 debugger/mcs51/Makefile
2713 Makefile.common:Makefile.common.in
2714 "}
2715 EOF
2716 cat >> $CONFIG_STATUS <<\EOF
2717 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2718   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2719   case "$ac_file" in
2720   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2721        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2722   *) ac_file_in="${ac_file}.in" ;;
2723   esac
2724
2725   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2726
2727   # Remove last slash and all that follows it.  Not all systems have dirname.
2728   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2729   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2730     # The file is in a subdirectory.
2731     test ! -d "$ac_dir" && mkdir "$ac_dir"
2732     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2733     # A "../" for each directory in $ac_dir_suffix.
2734     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2735   else
2736     ac_dir_suffix= ac_dots=
2737   fi
2738
2739   case "$ac_given_srcdir" in
2740   .)  srcdir=.
2741       if test -z "$ac_dots"; then top_srcdir=.
2742       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2743   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2744   *) # Relative path.
2745     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2746     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2747   esac
2748
2749   case "$ac_given_INSTALL" in
2750   [/$]*) INSTALL="$ac_given_INSTALL" ;;
2751   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2752   esac
2753
2754   echo creating "$ac_file"
2755   rm -f "$ac_file"
2756   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2757   case "$ac_file" in
2758   *Makefile*) ac_comsub="1i\\
2759 # $configure_input" ;;
2760   *) ac_comsub= ;;
2761   esac
2762
2763   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2764   sed -e "$ac_comsub
2765 s%@configure_input@%$configure_input%g
2766 s%@srcdir@%$srcdir%g
2767 s%@top_srcdir@%$top_srcdir%g
2768 s%@INSTALL@%$INSTALL%g
2769 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2770 fi; done
2771 rm -f conftest.s*
2772
2773 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2774 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2775 #
2776 # ac_d sets the value in "#define NAME VALUE" lines.
2777 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2778 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2779 ac_dC='\3'
2780 ac_dD='%g'
2781 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2782 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2783 ac_uB='\([      ]\)%\1#\2define\3'
2784 ac_uC=' '
2785 ac_uD='\4%g'
2786 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2787 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2788 ac_eB='$%\1#\2define\3'
2789 ac_eC=' '
2790 ac_eD='%g'
2791
2792 if test "${CONFIG_HEADERS+set}" != set; then
2793 EOF
2794 cat >> $CONFIG_STATUS <<EOF
2795   CONFIG_HEADERS="sdccconf.h:sdccconf_in.h"
2796 EOF
2797 cat >> $CONFIG_STATUS <<\EOF
2798 fi
2799 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2800   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2801   case "$ac_file" in
2802   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2803        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2804   *) ac_file_in="${ac_file}.in" ;;
2805   esac
2806
2807   echo creating $ac_file
2808
2809   rm -f conftest.frag conftest.in conftest.out
2810   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2811   cat $ac_file_inputs > conftest.in
2812
2813 EOF
2814
2815 # Transform confdefs.h into a sed script conftest.vals that substitutes
2816 # the proper values into config.h.in to produce config.h.  And first:
2817 # Protect against being on the right side of a sed subst in config.status.
2818 # Protect against being in an unquoted here document in config.status.
2819 rm -f conftest.vals
2820 cat > conftest.hdr <<\EOF
2821 s/[\\&%]/\\&/g
2822 s%[\\$`]%\\&%g
2823 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2824 s%ac_d%ac_u%gp
2825 s%ac_u%ac_e%gp
2826 EOF
2827 sed -n -f conftest.hdr confdefs.h > conftest.vals
2828 rm -f conftest.hdr
2829
2830 # This sed command replaces #undef with comments.  This is necessary, for
2831 # example, in the case of _POSIX_SOURCE, which is predefined and required
2832 # on some systems where configure will not decide to define it.
2833 cat >> conftest.vals <<\EOF
2834 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2835 EOF
2836
2837 # Break up conftest.vals because some shells have a limit on
2838 # the size of here documents, and old seds have small limits too.
2839
2840 rm -f conftest.tail
2841 while :
2842 do
2843   ac_lines=`grep -c . conftest.vals`
2844   # grep -c gives empty output for an empty file on some AIX systems.
2845   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2846   # Write a limited-size here document to conftest.frag.
2847   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2848   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2849   echo 'CEOF
2850   sed -f conftest.frag conftest.in > conftest.out
2851   rm -f conftest.in
2852   mv conftest.out conftest.in
2853 ' >> $CONFIG_STATUS
2854   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2855   rm -f conftest.vals
2856   mv conftest.tail conftest.vals
2857 done
2858 rm -f conftest.vals
2859
2860 cat >> $CONFIG_STATUS <<\EOF
2861   rm -f conftest.frag conftest.h
2862   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2863   cat conftest.in >> conftest.h
2864   rm -f conftest.in
2865   if cmp -s $ac_file conftest.h 2>/dev/null; then
2866     echo "$ac_file is unchanged"
2867     rm -f conftest.h
2868   else
2869     # Remove last slash and all that follows it.  Not all systems have dirname.
2870       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2871       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2872       # The file is in a subdirectory.
2873       test ! -d "$ac_dir" && mkdir "$ac_dir"
2874     fi
2875     rm -f $ac_file
2876     mv conftest.h $ac_file
2877   fi
2878 fi; done
2879
2880 EOF
2881 cat >> $CONFIG_STATUS <<EOF
2882
2883 EOF
2884 cat >> $CONFIG_STATUS <<\EOF
2885
2886 exit 0
2887 EOF
2888 chmod +x $CONFIG_STATUS
2889 rm -fr confdefs* $ac_clean_files
2890 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2891
2892 if test "$no_recursion" != yes; then
2893
2894   # Remove --cache-file and --srcdir arguments so they do not pile up.
2895   ac_sub_configure_args=
2896   ac_prev=
2897   for ac_arg in $ac_configure_args; do
2898     if test -n "$ac_prev"; then
2899       ac_prev=
2900       continue
2901     fi
2902     case "$ac_arg" in
2903     -cache-file | --cache-file | --cache-fil | --cache-fi \
2904     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
2905       ac_prev=cache_file ;;
2906     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
2907     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
2908       ;;
2909     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2910       ac_prev=srcdir ;;
2911     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2912       ;;
2913     *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
2914     esac
2915   done
2916
2917   for ac_config_dir in sim/ucsim; do
2918
2919     # Do not complain, so a configure script can configure whichever
2920     # parts of a large source tree are present.
2921     if test ! -d $srcdir/$ac_config_dir; then
2922       continue
2923     fi
2924
2925     echo configuring in $ac_config_dir
2926
2927     case "$srcdir" in
2928     .) ;;
2929     *)
2930       if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
2931       else
2932         { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
2933       fi
2934       ;;
2935     esac
2936
2937     ac_popdir=`pwd`
2938     cd $ac_config_dir
2939
2940       # A "../" for each directory in /$ac_config_dir.
2941       ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
2942
2943     case "$srcdir" in
2944     .) # No --srcdir option.  We are building in place.
2945       ac_sub_srcdir=$srcdir ;;
2946     /*) # Absolute path.
2947       ac_sub_srcdir=$srcdir/$ac_config_dir ;;
2948     *) # Relative path.
2949       ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
2950     esac
2951
2952     # Check for guested configure; otherwise get Cygnus style configure.
2953     if test -f $ac_sub_srcdir/configure; then
2954       ac_sub_configure=$ac_sub_srcdir/configure
2955     elif test -f $ac_sub_srcdir/configure.in; then
2956       ac_sub_configure=$ac_configure
2957     else
2958       echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
2959       ac_sub_configure=
2960     fi
2961
2962     # The recursion is here.
2963     if test -n "$ac_sub_configure"; then
2964
2965       # Make the cache file name correct relative to the subdirectory.
2966       case "$cache_file" in
2967       /*) ac_sub_cache_file=$cache_file ;;
2968       *) # Relative path.
2969         ac_sub_cache_file="$ac_dots$cache_file" ;;
2970       esac
2971   case "$ac_given_INSTALL" in
2972         [/$]*) INSTALL="$ac_given_INSTALL" ;;
2973         *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2974         esac
2975
2976       echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
2977       # The eval makes quoting arguments work.
2978       if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
2979       then :
2980       else
2981         { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
2982       fi
2983     fi
2984
2985     cd $ac_popdir
2986   done
2987 fi
2988
2989
2990 # End of configure/configure.in