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