OSDN Git Service

a71d6303f114fcd31d942952fa1f5e9338407830
[pf3gnuchains/pf3gnuchains4x.git] / newlib / configure.host
1 # configure.host
2
3 # This shell script handles all host based configuration for newlib.
4 # It sets various shell variables based on the the host and the
5 # configuration options.  You can modify this shell script without
6 # needing to rerun autoconf.
7
8 # This shell script should be invoked as
9 #   . configure.host
10 # If it encounters an error, it will exit with a message.
11
12 # FIXME: This script is too complicated.  It does things in too many
13 # different ways.  This was taken from the old Cygnus configure script
14 # with only minor changes.  It should be cleaned up.
15
16 # FIXME: The general approach of picking and choosing which
17 # directories to configure, other than machine_dir and sys_dir, is
18 # potentially confusing.
19
20 # It uses the following shell variables:
21 #   host                The configuration host
22 #   host_cpu            The configuration host CPU
23 #   newlib_mb           --enable-newlib-mb ("yes", "no")
24 #   target_optspace     --enable-target-optspace ("yes", "no", "")
25 #   newlib_multithread  --enable-newlib-multithread ("yes", "no", "yes")
26 #   newlib_elix_level   --enable-newlib-elix-level ("1","2","3","4") ("4")
27 #   newlib_io_c99_formats --enable-newlib-io-c99-formats ("yes", "no", "")
28 #   newlib_io_long_long --enable-newlib-io-long-long ("yes", "no", "")
29 #   newlib_io_long_double --enable-newlib-io-long-double ("yes", "no", "")
30
31 # It sets the following shell variables:
32 #   newlib_cflags       Special CFLAGS to use when building
33 #   machine_dir         Subdirectory of libc/machine to configure
34 #   sys_dir             Subdirectory of libc/sys to configure
35 #   have_sys_mach_dir   Is there a machine subdirectory in sys subdirectory
36 #   posix_dir           "posix" to build libc/posix, "" otherwise
37 #   signal_dir          "signal" to build libc/signal, "" otherwise
38 #   stdio64_dir         "stdio64" to build libc/stdio64, "" otherwise
39 #   syscall_dir         "syscalls" to build libc/syscalls, "" otherwise
40 #   unix_dir            "unix" to build libc/unix, "" otherwise
41 #   use_libtool         flag: use libtool to build newlib?
42 #   aext                library extension - needed for libtool support
43 #   oext                object file extension - needed for libtool support
44 #   lpfx                library object prefix - generated when no libtool
45 #   crt1                name of crt1 object if one is provided
46 #   crt1_dir            directory where crt1 object is found
47 #   have_crt0           "yes"/"no" if crt0 is/isn't provided.
48 #                       "" if crt0 is provided when sys_dir is set
49 #   noinclude           list of include files to not install
50
51 newlib_cflags=
52 libm_machine_dir=
53 machine_dir=
54 sys_dir=
55 posix_dir=
56 signal_dir=signal
57 stdio_dir=stdio
58 stdio64_dir=
59 xdr_dir=
60 syscall_dir=
61 unix_dir=
62 noinclude=
63 mach_add_setjmp=
64 crt1=
65 crt1_dir=
66 have_crt0=
67 use_libtool=no
68 have_sys_mach_dir=no
69 default_newlib_io_c99_formats=no
70 default_newlib_io_long_long=no
71 default_newlib_io_long_double=no
72 default_newlib_io_pos_args=no
73 default_newlib_atexit_dynamic_alloc=yes
74 aext=a
75 oext=o
76 lpfx="lib_a-"
77
78 case "${target_optspace}:${host}" in
79   yes:*)
80     newlib_cflags="${newlib_cflags} -Os"
81     ;;
82   :m32r-* | :d10v-* | :d30v-* | :avr-* | :m32c-* )
83     newlib_cflags="${newlib_cflags} -Os"
84     ;;
85   no:* | :*)
86     ;;
87 esac
88
89 # Get the source directories to use for the CPU type.
90 # machine_dir should supply CPU dependent routines, such as setjmp.
91 # newlib_cflags is passed to gcc when compiling.
92 # THIS TABLE IS ALPHA SORTED.  KEEP IT THAT WAY.
93
94 case "${host_cpu}" in
95   a29k)
96         machine_dir=a29k
97         ;;
98   arc)
99         machine_dir=
100         ;;
101   arm)
102         machine_dir=arm
103         ;;
104   avr*)
105         newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mcall-prologues"
106         ;;
107   bfin)
108         machine_dir=bfin
109         ;;
110   cr16*)
111         machine_dir=cr16
112        ;;
113   cris | crisv32)
114         machine_dir=cris
115         ;;
116   crx*)
117         machine_dir=crx
118         ;;
119   d10v*)
120         machine_dir=d10v
121         ;;
122   d30v*)
123         machine_dir=d30v
124         ;;
125   ep9312)
126         machine_dir=arm
127         ;;
128   fido)
129         machine_dir=m68k
130         newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
131         ;;
132   fr30)
133         machine_dir=fr30
134         ;;
135   frv)
136         machine_dir=frv
137         ;;
138   h8300)
139         machine_dir=h8300
140         ;;
141   h8500)
142         machine_dir=h8500
143         ;;
144   hppa*)
145         machine_dir=hppa
146         ;;
147   i960)
148         machine_dir=i960
149         ;;
150   i[34567]86)
151         # Don't use for these since they provide their own setjmp.
152         case ${host} in
153         *-*-sco* | *-*-cygwin*) 
154                 libm_machine_dir=i386
155                 machine_dir=i386
156                 ;;
157         *) 
158                 libm_machine_dir=i386
159                 machine_dir=i386
160                 mach_add_setjmp=true
161                 ;;
162         esac
163         ;;
164   ia64*)
165         ;;
166   iq2000)
167         machine_dir=iq2000
168         ;;
169   lm32)
170         machine_dir=lm32
171         ;;
172   m32c)
173         machine_dir=m32c
174         newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DSMALL_MEMORY"
175         ;;
176
177   m32r*)
178         machine_dir=m32r
179         ;;
180
181   m68hc11|m6811|m68hc12|m6812)
182         machine_dir=m68hc11
183         newlib_cflags="-DPREFER_SIZE_OVER_SPEED -Os -mrelax"
184         CFLAGS="-g -Os"
185         ;;
186   
187   m68*)
188         machine_dir=m68k
189         newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
190         ;;
191   m88k)
192         machine_dir=m88k
193         newlib_cflags="${newlib_cflags} -m88000"
194         ;;
195   m88110)
196         machine_dir=m88k
197         newlib_cflags="${newlib_cflags} -m88110"
198         ;;
199   mcore)
200         ;;
201   microblaze)
202         machine_dir=microblaze
203         ;;
204   mep)
205         machine_dir=mep
206         ;;
207   mips*)
208         machine_dir=mips
209         ;;
210   mmix)
211         ;;
212   mn10200)
213         machine_dir=mn10200
214         ;;
215   mn10300)
216         default_newlib_io_long_long="yes"
217         machine_dir=mn10300
218         ;;
219   moxie)
220         machine_dir=moxie
221         ;;
222   mt*)
223         machine_dir=mt
224         ;;
225   or16)
226         ;;
227   or32)
228         ;;
229   powerpc*)
230         machine_dir=powerpc
231         ;;
232   rx)
233         machine_dir=rx
234         default_newlib_io_long_long="yes"
235         newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
236         ;;
237   sh | sh64)
238         machine_dir=sh
239         ;;
240   sparc*)
241         machine_dir=sparc
242         # FIXME: Might wish to make MALLOC_ALIGNMENT more generic.
243         newlib_cflags="${newlib_cflags} -DMALLOC_ALIGNMENT=8"
244         ;;
245   strongarm)
246         machine_dir=arm
247         ;;
248   xscale)
249         machine_dir=xscale
250         ;;
251   thumb)
252         machine_dir=arm
253         ;;
254   tic4x|c4x)
255         machine_dir=tic4x
256         ;;
257   tic6x)
258         machine_dir=tic6x
259         ;;
260   tic80*)
261         machine_dir=tic80
262         ;;
263   v70)
264         ;;
265   v810)
266         ;;
267   v850*)
268         machine_dir=v850
269         newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED "
270         ;;
271   w65*)
272         machine_dir=w65
273         ;;
274   x86_64)
275         machine_dir=x86_64
276         ;;
277   xc16x*)
278     machine_dir=xc16x
279     ;;
280   xstormy16)
281         machine_dir=xstormy16
282         newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED"
283         newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED"
284         ;;
285   z8k)
286         machine_dir=z8k
287         ;;
288   spu)
289         stdio_dir=
290         libm_machine_dir=spu
291         machine_dir=spu
292         newlib_cflags="${newlib_cflags} -D_POSIX_MODE"
293         newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED"
294         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
295         newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
296         ;;
297   *)
298         echo '***' "Newlib does not support CPU ${host_cpu}" 1>&2
299         exit 1
300         ;;
301 esac
302
303 # Disable thread support if requested.
304
305 if [ "${newlib_multithread}" = "no" ] ; then
306         newlib_cflags="${newlib_cflags} -D__SINGLE_THREAD__"
307 fi
308
309 # Disable syscall support if requested.
310
311 if [ "${newlib_may_supply_syscalls}" = "no" ] ; then
312         newlib_cflags="${newlib_cflags} -D__NO_SYSCALLS__"
313 fi
314
315 # Enable multibyte support if requested or it is defaulted
316 # for target.
317
318 if [ "x${newlib_mb}" = "x" ]; then
319         case "${host}" in
320           i[34567]86-pc-linux-*|*-*-cygwin*)
321                 newlib_mb=yes
322                 ;;
323         esac
324 fi
325
326 # Disable printf/scanf floating-point support if requested.
327
328 if [ "${newlib_io_float}" = "no" ] ; then
329         newlib_cflags="${newlib_cflags} -DNO_FLOATING_POINT"
330 fi
331
332 # Verify if shared newlib support is allowed and set appropriate variables
333 # We don't want to use libtool for platforms that we are not going to
334 # support shared libraries.  This is because it adds executable tests which
335 # we don't want for most embedded platforms.
336 case "${host}" in
337   i[34567]86-pc-linux-*)
338     use_libtool=yes
339     have_sys_mach_dir=yes
340     stdio64_dir=stdio64
341     oext=lo
342     lpfx=
343     aext=la ;;
344   *) ;; #shared library not supported for ${host}
345 esac
346
347 # Get the source directories to use for the host.  unix_dir is set
348 # to unix to get some standard Unix routines.  posix_dir is set to get some
349 # standard Posix routines.  sys_dir should supply system dependent routines
350 # including crt0.
351 # THIS TABLE IS ALPHA SORTED.  KEEP IT THAT WAY.
352
353 case "${host}" in
354   *-*-cygwin*)
355         posix_dir=posix
356         stdio64_dir=stdio64
357         xdr_dir=xdr
358         ;;
359   *-*-netware*)
360         signal_dir=
361         sys_dir=netware
362         ;;
363   *-*-rtems*)                   # generic RTEMS support
364         sys_dir=rtems
365         posix_dir=posix
366         unix_dir=unix
367         ;;
368   a29k-*-*)
369         sys_dir=a29khif
370         signal_dir=
371         ;;
372   arc-*-*)
373         sys_dir=arc
374         ;;
375   arm-*-*)
376         sys_dir=arm
377         if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
378           have_crt0="no"
379         fi
380         ;;
381   bfin-*-*)
382         sys_dir=
383         ;;
384   cr16-*-*)
385         sys_dir=
386         ;;
387   crx*)
388         sys_dir=
389         ;;
390   d10v*)
391         sys_dir=d10v
392         ;;
393   d30v*)
394         sys_dir=
395         ;;
396   ep9312-*-*)
397         sys_dir=arm
398         if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
399           have_crt0="no"
400         fi
401         ;;
402   frv*)
403         sys_dir=
404         ;;
405   h8300-*-hms*)
406         sys_dir=h8300hms
407         ;;
408   h8300-*-elf*)
409         sys_dir=h8300hms
410         ;;
411   h8300-*-coff*)
412         sys_dir=h8300hms
413         ;;
414   h8300-*-xray*)
415         sys_dir=h8300xray
416         ;;
417   h8500-*-hms*)
418         sys_dir=h8500hms
419         ;;
420   h8500-*-elf*)
421         sys_dir=h8500hms
422         ;;
423   i[34567]86-*-rdos*)
424         sys_dir=rdos
425         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
426         ;;
427   i[34567]86-*-sco*)
428         sys_dir=sysvi386
429         unix_dir=unix
430         ;;
431   i[34567]86-pc-linux-*)
432         sys_dir=linux
433         unix_dir=unix
434         posix_dir=posix
435         crt1=crt1.o
436         crt1_dir=libc/sys/${sys_dir}    
437         gcc_dir=`gcc -print-search-dirs | awk '/^install:/{print $2}'`
438         default_newlib_io_c99_formats="yes"
439         default_newlib_io_long_double="yes"
440         default_newlib_io_long_long="yes"
441         default_newlib_io_pos_args="yes"
442         #newlib_cflags="${newlib_cflags} -Werror" # DEBUGGING ONLY;BREAKS BUILD
443         newlib_cflags="${newlib_cflags} -Wall"
444         newlib_cflags="${newlib_cflags} -D_I386MACH_ALLOW_HW_INTERRUPTS"
445         newlib_cflags="${newlib_cflags} -DHAVE_FCNTL"
446         newlib_cflags="${newlib_cflags} -DHAVE_GETOPT"
447         # --- Required when building a shared library ------------------------
448         newlib_cflags="${newlib_cflags} -fPIC -D_I386MACH_NEED_SOTYPE_FUNCTION"
449         # --- The three lines below are optional ------------------------------
450         ##newlib_cflags="${newlib_cflags} -nostdinc"
451         ##newlib_cflags="${newlib_cflags} -I`newlib-flags --kernel-dir`/include"
452         ##newlib_cflags="${newlib_cflags} -idirafter ${gcc_dir}include"
453         ;;
454
455   m68hc11-*-*|m6811-*-*|m6812-*-*|m68hc12-*-*)
456         ;;
457
458   m68k-sun-sunos*)
459         unix_dir=unix
460         ;;
461   m8*-bug-*)
462         sys_dir=m88kbug
463         ;;
464   mep-*-*)
465         default_newlib_io_long_long="yes"
466         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
467         ;;
468   microblaze-*-*)
469         machine_dir=microblaze
470         ;;
471   mips*-dec-*)
472         sys_dir=decstation
473         ;;
474   mmix-knuth-mmixware)
475         sys_dir=mmixware
476         ;;
477   moxie*)
478         sys_dir=
479         ;;
480   powerpcle-*-pe)
481         posix_dir=posix
482         ;;
483   sh*-*)
484         sys_dir=sh
485         ;;
486   sparc-sun-sunos*)
487         sys_dir=sun4
488         unix_dir=unix
489         ;;
490   sparc64*)
491         sys_dir=sparc64
492         unix_dir=unix
493         ;;
494   spu-*-*)
495         default_newlib_io_long_long="yes"
496         default_newlib_atexit_dynamic_alloc="no"
497         ;;
498   strongarm-*-*)
499         sys_dir=arm
500         if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
501           have_crt0="no"
502         fi
503         ;;
504   thumb-*-*)
505         sys_dir=arm
506         if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
507           have_crt0="no"
508         fi
509         ;;
510   tic6x*)
511         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
512         have_crt0="no"
513         ;;
514   tic80*)
515         sys_dir=tic80
516         ;;
517   v70-nec-*)
518         sys_dir=sysvnecv70
519         ;;
520   v810-*-*)
521         sys_dir=sysnec810
522         ;;
523   v850*-*-*)
524         sys_dir=sysnecv850
525         if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
526           have_crt0="no"
527         fi
528         ;;
529   w65-*-*)
530         sys_dir=w65
531         ;;
532   xscale-*-*)
533         sys_dir=arm
534         if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
535           have_crt0="no"
536         fi
537         ;;
538   z8k-*-coff)
539         sys_dir=z8ksim
540         ;;
541 esac
542
543 # Host specific flag settings -- usually for features that are not
544 # general enough or broad enough to be handled above.
545 # THIS TABLE IS ALPHA SORTED.  KEEP IT THAT WAY.
546
547 case "${host}" in
548   *-*-cygwin*)
549         test -z "$cygwin_srcdir" && cygwin_srcdir=`cd ${srcdir}/../winsup/cygwin; pwd`
550         export cygwin_srcdir
551         default_newlib_io_c99_formats="yes"
552         default_newlib_io_long_long="yes"
553         default_newlib_io_long_double="yes"
554         default_newlib_io_pos_args="yes"
555         CC="${CC} -I${cygwin_srcdir}/include"
556         newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED"
557         syscall_dir=syscalls
558         ;;
559 # RTEMS supplies its own versions of some routines:
560 #       malloc()            (reentrant version)
561 #       exit()              RTEMS has a "global" reent to flush
562 #       signal()/raise()    RTEMS has its own including pthread signals
563 #       _XYZ_r()            RTEMS has its own reentrant routines
564 #
565 #  NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
566   *-*-rtems*)
567         default_newlib_io_long_long="yes"
568         default_newlib_io_c99_formats="yes"
569         newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB"
570         newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC"
571         # turn off unsupported items in posix directory 
572         newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN"
573         ;;
574 # VxWorks supplies its own version of malloc, and the newlib one
575 # doesn't work because VxWorks does not have sbrk.
576   *-wrs-vxworks*)
577         newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -DHAVE_FCNTL"
578         ;;
579 # UDI doesn't have exec, so system() should fail the right way
580   a29k-amd-udi)
581         newlib_cflags="${newlib_cflags} -DNO_EXEC"
582         syscall_dir=syscalls
583         ;;
584   arc-*-*)
585         syscall_dir=syscalls
586         ;;
587   arm-*-pe)
588         syscall_dir=syscalls
589         ;;
590   arm-*-*)
591         syscall_dir=syscalls
592 # If newlib is supplying syscalls, select which debug protocol is being used.
593 # ARM_RDP_MONITOR selects the Demon monitor.
594 # ARM_RDI_MONITOR selects the Angel monitor.
595 # If neither are defined, then hard coded defaults will be used
596 # to create the program's environment.
597 # If --disable-newlib-supplied-syscalls is specified, then the end-user
598 # may specify the protocol via gcc spec files supplied by libgloss.
599 # See also thumb below.
600         if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
601 #         newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
602           newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
603         fi
604         ;;
605   arc*)
606         newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED"
607         ;;
608   avr*)
609         newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
610         ;;
611   bfin*)
612         syscall_dir=syscalls
613         ;;
614   cris-*-* | crisv32-*-*)
615         default_newlib_io_long_long="yes"
616         newlib_cflags="${newlib_cflags} -DHAVE_RENAME -D_USE_WRITE -DCOMPACT_CTYPE"
617         syscall_dir=syscalls
618         ;;
619   cr16-*-*)
620         syscall_dir=syscalls
621         ;;
622   crx-*-*)
623         newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DMISSING_SYSCALL_NAMES"
624         syscall_dir=
625         ;;
626   d10v*)
627         newlib_cflags="${newlib_cflags} -DSMALL_MEMORY"
628         syscall_dir=syscalls
629         ;;
630   d30v*)
631         newlib_cflags="${newlib_cflags} -DABORT_MESSAGE -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
632         syscall_dir=
633         ;;
634   ep9312-*-*)
635         syscall_dir=syscalls
636         if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
637           newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
638         fi
639         ;;
640   fido-*-elf)
641         newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DHAVE_SYSTEM -DMISSING_SYSCALL_NAMES"
642         syscall_dir=
643         ;;
644   fr30-*-*)
645         syscall_dir=syscalls
646         ;;
647   frv-*-*)
648         syscall_dir=syscalls
649         default_newlib_io_long_long="yes"
650         ;;
651   h8300*-*-*)
652         syscall_dir=syscalls    
653         default_newlib_io_long_long="yes"
654         newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
655         # Simulator only extensions for H8300.
656         # Uncomment the next line to enable them.
657         # newlib_cflags="${newlib_cflags} -D__SIMULATOR__"
658         ;;      
659   h8500-*-*)
660         syscall_dir=syscalls    
661         newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
662         ;;      
663   i[34567]86-*-sco*)
664         newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED -DHAVE_FCNTL"
665         ;;
666   i[34567]86-*-netware*)
667         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC -DABORT_PROVIDED -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DHAVE_FCNTL"
668         ;;
669   iq2000*)
670         syscall_dir=syscalls
671         default_newlib_io_long_long="yes"
672         ;;
673   lm32-*-*)
674         syscall_dir=syscalls
675         ;;
676   m32c-*-*)
677         default_newlib_io_long_long="yes"
678         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DABORT_PROVIDED"
679         syscall_dir=
680         ;;
681   m32r-*-*)
682         # Pass -msdata=sdata so _impure_ptr goes in .sdata.
683         # We don't generate sda relocs however for upward compatibility.
684         # FIXME: This is necessary because the default multilib doesn't
685         # use --print-multi-lib.
686         newlib_cflags="${newlib_cflags} -msdata=sdata"
687         syscall_dir=syscalls
688         ;;
689   m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
690         newlib_cflags="${newlib_cflags} -DNO_EXEC -DABORT_PROVIDED -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
691         ;;
692   m68k-unknown-elf)
693         newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DHAVE_SYSTEM -DMISSING_SYSCALL_NAMES"
694         syscall_dir=
695         ;;
696   mcore-*-*)
697         syscall_dir=syscalls
698         ;;
699   microblaze-*-*)
700         default_newlib_io_long_long="yes"
701         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DSMALL_MEMORY -D_REENT_SMALL"
702         ;;
703   mips64vr*-*-*)
704         default_newlib_io_long_long="yes"
705         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
706         ;;
707   mips*-*-elf*)
708         default_newlib_io_long_long="yes"
709         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
710         ;;
711   mmix-*)
712         syscall_dir=syscalls
713         # We need every symbol 32-bit aligned, so the invalid
714         # construct with attribute ((alias ("_ctype_b+127"))) breaks.
715         newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
716         ;;
717   mn10?00-*-*)
718         syscall_dir=syscalls
719         ;;
720   moxie-*-*)
721         syscall_dir=syscalls
722         default_newlib_io_long_long="yes"
723         ;;
724   powerpc*-*-eabialtivec*)
725         default_newlib_io_long_long="yes"
726         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
727         ;;
728   powerpc*-*-eabispe*)
729         default_newlib_io_long_long="yes"
730         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
731         ;;
732   powerpc*-*-eabi* | \
733   powerpc*-*-elf* | \
734   powerpc*-*-linux* | \
735   powerpc*-*-rtem* | \
736   powerpc*-*-sysv* | \
737   powerpc*-*-solaris*)
738         default_newlib_io_long_long="yes"
739         newlib_cflags="${newlib_cflags} -mrelocatable-lib -mno-eabi -mstrict-align -DMISSING_SYSCALL_NAMES"
740         ;;
741   powerpcle-*-pe)
742         newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DHAVE_FCNTL"
743         syscall_dir=syscalls
744         ;;
745   sh*-*-*)
746         default_newlib_io_long_long="yes"
747         syscall_dir=syscalls
748         ;;
749   sparc-sun-sunos*)
750         newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED"
751         ;;
752   sparc64-*-*)
753         newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_BLKSIZE -DHAVE_FCNTL"
754         # This either belongs elsewhere or nowhere. But I need *something*,
755         # so for now it's here ...
756         case "${host_os}" in
757           aoutv8 | *32p)
758                 newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=32" ;;
759           *)
760                 newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=64" ;;
761         esac
762         ;;
763   strongarm-*-*)
764         syscall_dir=syscalls
765         ;;
766   thumb-*-pe)
767         syscall_dir=syscalls
768 # Don't use the debugging protocols just yet.
769         ;;
770   thumb-*-*)
771         syscall_dir=syscalls
772 # If newlib is supplying syscalls, select which debug protocol is being used.
773 # ARM_RDP_MONITOR selects the Demon monitor.
774 # ARM_RDI_MONITOR selects the Angel monitor.
775 # If neither are defined, then hard coded defaults will be used
776 # to create the program's environment.
777 # If --disable-newlib-supplied-syscalls is specified, then the end-user
778 # may specify the protocol via gcc spec files supplied by libgloss.
779         if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
780 #         newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
781           newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
782         fi
783         ;;
784   tic6x*)
785         syscall_dir=
786         newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED"
787         ;;
788   tic80*)
789         syscall_dir=syscalls
790         ;;
791   v850*-*-*)
792         syscall_dir=syscalls
793         ;;
794   w65-*-*)
795         syscall_dir=syscalls    
796         newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
797         ;;
798   xc16x-*)
799           syscall_dir=syscalls
800         ;;
801   xscale-*-*)
802         syscall_dir=syscalls
803         newlib_cflags="${newlib_cflags} -DHAVE_SYSTEM -DHAVE_RENAME"
804         if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
805           newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
806         fi
807         ;;
808   xstormy16-*-*)
809         syscall_dir=syscalls
810         ;;
811   z8k-*-*)
812         syscall_dir=syscalls
813         ;;
814   *)
815         newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
816         syscall_dir=
817         ;;
818 esac
819
820 # Use defaults for certain settings if not specified by user
821
822 # Enable C99 format support in I/O routines if requested.
823 if [ "x${newlib_io_c99_formats}" = "x" ]; then
824         if [ ${default_newlib_io_c99_formats} = "yes" ]; then
825                 newlib_io_c99_formats="yes";
826         fi
827 fi
828
829 # Enable long long support in I/O routines if requested.
830 if [ "x${newlib_io_long_long}" = "x" ]; then
831         if [ ${default_newlib_io_long_long} = "yes" ]; then
832                 newlib_io_long_long="yes";
833         fi
834 fi
835
836 # Enable long double support in I/O routines if requested.
837 if [ "x${newlib_io_long_double}" = "x" ]; then
838         if [ ${default_newlib_io_long_double} = "yes" ]; then
839                 newlib_io_long_double="yes";
840         fi
841 fi
842
843 # Enable printf positional argument support if requested.
844 if [ "x${newlib_io_pos_args}" = "x" ]; then
845         if [ ${default_newlib_io_pos_args} = "yes" ]; then
846                 newlib_io_pos_args="yes";
847         fi
848 fi
849
850 # Disable atexit dynamic allocation if requested.
851 if [ "x${newlib_atexit_dynamic_alloc}" = "x" ]; then
852         if [ ${default_newlib_atexit_dynamic_alloc} = "yes" ]; then
853                 newlib_atexit_dynamic_alloc="yes"; 
854         fi
855 fi
856
857 # Remove rpc headers if xdr_dir not specified
858 if [ "x${xdir_dir}" = "x" ]; then
859         noinclude="${noinclude} rpc/types.h rpc/xdr.h"
860 fi
861
862 if test -z "${have_crt0}" && test -n "${sys_dir}"; then
863   have_crt0="yes"
864 fi