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