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