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