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