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