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