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