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