]> sourceware.org Git - newlib-cygwin.git/blame - newlib/configure.host
* configure.host: Allow hosts to set the default
[newlib-cygwin.git] / newlib / configure.host
CommitLineData
8a0efa53
CF
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", "")
da25e61f
JJ
25# newlib_multithread --enable-newlib-multithread ("yes", "no", "yes")
26# newlib_elix_level --enable-newlib-elix-level ("1","2","3","4") ("4")
227e6ef6
JJ
27# newlib_io_long_long --enable-newlib-io-long-long ("yes", "no", "")
28# newlib_io_long_double --enable-newlib-io-long-double ("yes", "no", "")
8a0efa53
CF
29
30# It sets the following shell variables:
31# newlib_cflags Special CFLAGS to use when building
32# machine_dir Subdirectory of libc/machine to configure
33# sys_dir Subdirectory of libc/sys to configure
bfc27bae 34# have_sys_mach_dir Is there a machine subdirectory in sys subdirectory
8a0efa53
CF
35# posix_dir "posix" to build libc/posix, "" otherwise
36# signal_dir "signal" to build libc/signal, "" otherwise
9b022d6d 37# stdio64_dir "stdio64" to build libc/stdio64, "" otherwise
8a0efa53
CF
38# syscall_dir "syscalls" to build libc/syscalls, "" otherwise
39# unix_dir "unix" to build libc/unix, "" otherwise
2e1a7175
TF
40# use_libtool flag: use libtool to build newlib?
41# aext library extension - needed for libtool support
42# oext object file extension - needed for libtool support
6e6cd5bd
JJ
43# crt1 name of crt1 object if one is provided
44# crt1_dir directory where crt1 object is found
45c8bb8f
JJ
45# have_crt0 "yes"/"no" if crt0 is/isn't provided.
46# "" if crt0 is provided when sys_dir is set
8a0efa53
CF
47
48newlib_cflags=
2e1a7175 49libm_machine_dir=
8a0efa53
CF
50machine_dir=
51sys_dir=
52posix_dir=
53signal_dir=signal
dee51391 54stdio64_dir=
8a0efa53
CF
55syscall_dir=
56unix_dir=
57mach_add_setjmp=
6e6cd5bd
JJ
58crt1=
59crt1_dir=
45c8bb8f 60have_crt0=
2e1a7175 61use_libtool=no
fa4a16a1 62have_sys_mach_dir=no
227e6ef6
JJ
63default_newlib_io_long_long=no
64default_newlib_io_long_double=no
65default_newlib_io_pos_args=no
ce93dfe4 66default_newlib_atexit_dynamic_alloc=yes
2e1a7175
TF
67aext=a
68oext=o
8a0efa53
CF
69
70case "${target_optspace}:${host}" in
71 yes:*)
72 newlib_cflags="${newlib_cflags} -Os"
73 ;;
56448afa 74 :m32r-* | :d10v-* | :d30v-* | :avr-* | :m32c-* )
8a0efa53
CF
75 newlib_cflags="${newlib_cflags} -Os"
76 ;;
77 no:* | :*)
78 newlib_cflags="${newlib_cflags} -O2"
79 ;;
80esac
81
82# Get the source directories to use for the CPU type.
83# machine_dir should supply CPU dependent routines, such as setjmp.
84# newlib_cflags is passed to gcc when compiling.
85# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
86
87case "${host_cpu}" in
88 a29k)
89 machine_dir=a29k
90 ;;
91 arc)
92 machine_dir=
93 ;;
94 arm)
95 machine_dir=arm
96 ;;
4634da64
JJ
97 avr*)
98 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mcall-prologues"
99 ;;
1815fdea
JJ
100 cris | crisv32)
101 machine_dir=cris
102 ;;
1185687a
JJ
103 crx*)
104 machine_dir=crx
105 ;;
8a0efa53
CF
106 d10v*)
107 machine_dir=d10v
108 ;;
109 d30v*)
110 machine_dir=d30v
111 ;;
bac50d6b
NC
112 ep9312)
113 machine_dir=arm
114 ;;
8a0efa53
CF
115 fr30)
116 machine_dir=fr30
117 ;;
bac50d6b
NC
118 frv)
119 machine_dir=frv
120 ;;
8a0efa53
CF
121 h8300)
122 machine_dir=h8300
123 ;;
124 h8500)
125 machine_dir=h8500
126 ;;
127 hppa*)
128 machine_dir=hppa
129 ;;
130 i960)
131 machine_dir=i960
132 ;;
102861c9 133 i[34567]86)
8a0efa53
CF
134 # Don't use for these since they provide their own setjmp.
135 case ${host} in
d693ad84 136 *-*-sco* | *-*-cygwin*)
2e1a7175 137 libm_machine_dir=i386
8a0efa53
CF
138 machine_dir=i386
139 ;;
140 *)
2e1a7175 141 libm_machine_dir=i386
8a0efa53
CF
142 machine_dir=i386
143 mach_add_setjmp=true
144 ;;
145 esac
146 ;;
ec463fc7
JW
147 ia64*)
148 ;;
bfdfd7e6
AG
149 iq2000)
150 machine_dir=iq2000
151 ;;
56448afa
JJ
152 m32c)
153 machine_dir=m32c
154 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DABORT_PROVIDED -DSMALL_MEMORY"
155 ;;
156
8a0efa53
CF
157 m32r*)
158 machine_dir=m32r
159 ;;
a703e0f2
JJ
160
161 m68hc11|m6811|m68hc12|m6812)
162 machine_dir=m68hc11
163 newlib_cflags="-DPREFER_SIZE_OVER_SPEED -Os -mrelax"
164 CFLAGS="-g -Os"
165 ;;
166
8a0efa53
CF
167 m68*)
168 machine_dir=m68k
55500bf1 169 newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
8a0efa53
CF
170 ;;
171 m88k)
172 machine_dir=m88k
173 newlib_cflags="${newlib_cflags} -m88000"
174 ;;
175 m88110)
176 machine_dir=m88k
177 newlib_cflags="${newlib_cflags} -m88110"
178 ;;
179 mcore)
180 ;;
181 mips*)
182 machine_dir=mips
183 ;;
8be9b48b
JJ
184 mmix)
185 ;;
8a0efa53
CF
186 mn10200)
187 machine_dir=mn10200
188 ;;
189 mn10300)
cf55bf5e 190 default_newlib_io_long_long="yes"
8a0efa53
CF
191 machine_dir=mn10300
192 ;;
74ecef0d
NS
193 mt*)
194 machine_dir=mt
dee9edd9 195 ;;
9e5dd5ea
JJ
196 or16)
197 ;;
198 or32)
199 ;;
8a0efa53
CF
200 powerpc*)
201 machine_dir=powerpc
202 ;;
9f25eed9 203 sh | sh64)
8a0efa53
CF
204 machine_dir=sh
205 ;;
206 sparc*)
207 machine_dir=sparc
208 # FIXME: Might wish to make MALLOC_ALIGNMENT more generic.
209 newlib_cflags="${newlib_cflags} -DMALLOC_ALIGNMENT=8"
210 ;;
211 strongarm)
212 machine_dir=arm
213 ;;
0ffc3b94
NC
214 xscale)
215 machine_dir=xscale
216 ;;
8a0efa53
CF
217 thumb)
218 machine_dir=arm
219 ;;
94d61fcb
JJ
220 tic4x|c4x)
221 machine_dir=tic4x
222 ;;
8a0efa53
CF
223 tic80*)
224 machine_dir=tic80
225 ;;
226 v70)
227 ;;
228 v810)
229 ;;
230 v850)
231 machine_dir=v850
92b57543 232 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 "
8a0efa53
CF
233 ;;
234 v850e)
235 machine_dir=v850
0302dfe5 236 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED "
8a0efa53
CF
237 ;;
238 w65*)
239 machine_dir=w65
240 ;;
f6eff1c0
GK
241 xstormy16)
242 machine_dir=xstormy16
9c2e7642 243 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED"
578a3560 244 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED"
f6eff1c0 245 ;;
8a0efa53
CF
246 z8k)
247 machine_dir=z8k
248 ;;
249 *)
250 echo '***' "Newlib does not support CPU ${host_cpu}" 1>&2
251 exit 1
252 ;;
253esac
254
0c048a9a
TF
255# Disable thread support if requested.
256
257if [ "${newlib_multithread}" = "no" ] ; then
258 newlib_cflags="${newlib_cflags} -D__SINGLE_THREAD__"
259fi
260
313f1349
JJ
261# Disable syscall support if requested.
262
263if [ "${newlib_may_supply_syscalls}" = "no" ] ; then
264 newlib_cflags="${newlib_cflags} -D__NO_SYSCALLS__"
265fi
266
a8615092
JJ
267# Enable multibyte support if requested or it is defaulted
268# for target.
8a0efa53 269
a8615092
JJ
270if [ "x${newlib_mb}" = "x" ]; then
271 case "${host}" in
102861c9 272 i[34567]86-pc-linux-*|*-*-cygwin*)
a8615092 273 newlib_mb=yes
da25e61f 274 ;;
a8615092
JJ
275 esac
276fi
277
afecf2fa
JJ
278# Disable printf/scanf floating-point support if requested.
279
280if [ "${newlib_io_float}" = "no" ] ; then
281 newlib_cflags="${newlib_cflags} -DNO_FLOATING_POINT"
282fi
283
2e1a7175
TF
284# Verify if shared newlib support is allowed and set appropriate variables
285# We don't want to use libtool for platforms that we are not going to
286# support shared libraries. This is because it adds executable tests which
287# we don't want for most embedded platforms.
288case "${host}" in
102861c9 289 i[34567]86-pc-linux-*)
2e1a7175 290 use_libtool=yes
fa4a16a1 291 have_sys_mach_dir=yes
dee51391 292 stdio64_dir=stdio64
2e1a7175
TF
293 oext=lo
294 aext=la ;;
295 *) ;; #shared library not supported for ${host}
296esac
297
8a0efa53
CF
298# Get the source directories to use for the host. unix_dir is set
299# to unix to get some standard Unix routines. posix_dir is set to get some
300# standard Posix routines. sys_dir should supply system dependent routines
301# including crt0.
302# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
303
304case "${host}" in
305 *-*-cygwin*)
8a0efa53 306 posix_dir=posix
5582abd2 307 stdio64_dir=stdio64
8a0efa53
CF
308 ;;
309 *-*-netware*)
310 signal_dir=
311 sys_dir=netware
312 ;;
313 *-*-rtems*) # generic RTEMS support
314 sys_dir=rtems
315 # RTEMS POSIX support is all inside RTEMS
316 ;;
317 a29k-*-*)
318 sys_dir=a29khif
319 signal_dir=
320 ;;
321 arc-*-*)
322 sys_dir=arc
323 ;;
324 arm-*-*)
45c8bb8f
JJ
325 sys_dir=arm
326 if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
327 have_crt0="no"
a170abec 328 fi
8a0efa53 329 ;;
1185687a
JJ
330 crx*)
331 sys_dir=
332 ;;
8a0efa53
CF
333 d10v*)
334 sys_dir=d10v
335 ;;
336 d30v*)
337 sys_dir=
338 ;;
bac50d6b 339 ep9312-*-*)
45c8bb8f
JJ
340 sys_dir=arm
341 if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
342 have_crt0="no"
a170abec 343 fi
bac50d6b 344 ;;
a170abec
JJ
345 frv*)
346 sys_dir=
347 ;;
8a0efa53
CF
348 h8300-*-hms*)
349 sys_dir=h8300hms
350 ;;
1ae900d6
JR
351 h8300-*-elf*)
352 sys_dir=h8300hms
353 ;;
dd671cde
TF
354 h8300-*-coff*)
355 sys_dir=h8300hms
356 ;;
8a0efa53
CF
357 h8300-*-xray*)
358 sys_dir=h8300xray
359 ;;
360 h8500-*-hms*)
361 sys_dir=h8500hms
362 ;;
1ae900d6
JR
363 h8500-*-elf*)
364 sys_dir=h8500hms
365 ;;
d968b3c8
JJ
366 i[34567]86-*-rdos*)
367 sys_dir=rdos
368 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
369 ;;
102861c9 370 i[34567]86-*-sco*)
8a0efa53
CF
371 sys_dir=sysvi386
372 unix_dir=unix
373 ;;
102861c9 374 i[34567]86-pc-linux-*)
2efbc2a7
JJ
375 sys_dir=linux
376 unix_dir=unix
377 posix_dir=posix
6e6cd5bd
JJ
378 crt1=crt1.o
379 crt1_dir=libc/sys/${sys_dir}
2efbc2a7 380 gcc_dir=`gcc -print-search-dirs | awk '/^install:/{print $2}'`
227e6ef6
JJ
381 default_newlib_io_long_double="yes"
382 default_newlib_io_long_long="yes"
383 default_newlib_io_pos_args="yes"
2efbc2a7
JJ
384 #newlib_cflags="${newlib_cflags} -Werror" # DEBUGGING ONLY;BREAKS BUILD
385 newlib_cflags="${newlib_cflags} -Wall"
386 newlib_cflags="${newlib_cflags} -D_I386MACH_ALLOW_HW_INTERRUPTS"
fe359733 387 newlib_cflags="${newlib_cflags} -DHAVE_FCNTL"
2e1a7175 388 # --- Required when building a shared library ------------------------
2efbc2a7
JJ
389 newlib_cflags="${newlib_cflags} -fPIC -D_I386MACH_NEED_SOTYPE_FUNCTION"
390 # --- The three lines below are optional ------------------------------
391 ##newlib_cflags="${newlib_cflags} -nostdinc"
392 ##newlib_cflags="${newlib_cflags} -I`newlib-flags --kernel-dir`/include"
393 ##newlib_cflags="${newlib_cflags} -idirafter ${gcc_dir}include"
394 ;;
8d9112f2 395
a703e0f2
JJ
396 m68hc11-*-*|m6811-*-*|m6812-*-*|m68hc12-*-*)
397 ;;
398
8a0efa53
CF
399 m68k-sun-sunos*)
400 unix_dir=unix
401 ;;
402 m8*-bug-*)
403 sys_dir=m88kbug
404 ;;
405 mips*-dec-*)
406 sys_dir=decstation
407 ;;
8be9b48b
JJ
408 mmix-knuth-mmixware)
409 sys_dir=mmixware
410 ;;
8a0efa53 411 powerpcle-*-pe)
8a0efa53
CF
412 posix_dir=posix
413 ;;
414 sh*-*)
415 sys_dir=sh
416 ;;
417 sparc-sun-sunos*)
418 sys_dir=sun4
419 unix_dir=unix
420 ;;
421 sparc64*)
422 sys_dir=sparc64
423 unix_dir=unix
424 ;;
425 strongarm-*-*)
45c8bb8f
JJ
426 sys_dir=arm
427 if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
428 have_crt0="no"
a170abec 429 fi
0ffc3b94 430 ;;
8a0efa53 431 thumb-*-*)
45c8bb8f
JJ
432 sys_dir=arm
433 if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
434 have_crt0="no"
a170abec 435 fi
8a0efa53
CF
436 ;;
437 tic80*)
438 sys_dir=tic80
439 ;;
440 v70-nec-*)
441 sys_dir=sysvnecv70
442 ;;
443 v810-*-*)
444 sys_dir=sysnec810
445 ;;
446 v850-*-*)
447 sys_dir=sysnecv850
448 ;;
449 v850e-*-*)
450 sys_dir=sysnecv850
451 ;;
452 v850ea-*-*)
453 sys_dir=sysnecv850
454 ;;
455 w65-*-*)
456 sys_dir=w65
457 ;;
a170abec 458 xscale-*-*)
45c8bb8f
JJ
459 sys_dir=arm
460 if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
461 have_crt0="no"
a170abec
JJ
462 fi
463 ;;
8a0efa53
CF
464 z8k-*-coff)
465 sys_dir=z8ksim
466 ;;
467esac
468
469# Host specific flag settings -- usually for features that are not
470# general enough or broad enough to be handled above.
471# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
472
473case "${host}" in
474 *-*-cygwin*)
03536757
CF
475 test -z "$cygwin_srcdir" && cygwin_srcdir=`cd ${srcdir}/../winsup/cygwin; pwd`
476 export cygwin_srcdir
227e6ef6
JJ
477 default_newlib_io_long_long="yes"
478 default_newlib_io_long_double="yes"
479 default_newlib_io_pos_args="yes"
e633fde1
CF
480 CC="${CC} -I${cygwin_srcdir}/include"
481 newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_FCNTL -DMALLOC_PROVIDED"
8a0efa53
CF
482 syscall_dir=syscalls
483 ;;
484# RTEMS supplies its own versions of some routines:
485# malloc() (reentrant version)
486# exit() RTEMS has a "global" reent to flush
487# signal()/raise() RTEMS has its own including pthread signals
488# _XYZ_r() RTEMS has its own reentrant routines
489#
490# NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
491 *-*-rtems*)
227e6ef6
JJ
492 default_newlib_io_long_long="yes"
493 newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL"
8a0efa53
CF
494 ;;
495# VxWorks supplies its own version of malloc, and the newlib one
496# doesn't work because VxWorks does not have sbrk.
497 *-wrs-vxworks*)
3a8fc0e4 498 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -DHAVE_FCNTL"
8a0efa53
CF
499 ;;
500# UDI doesn't have exec, so system() should fail the right way
501 a29k-amd-udi)
502 newlib_cflags="${newlib_cflags} -DNO_EXEC"
503 syscall_dir=syscalls
504 ;;
505 arc-*-*)
506 syscall_dir=syscalls
507 ;;
508 arm-*-pe)
509 syscall_dir=syscalls
510 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
8a0efa53
CF
511 ;;
512 arm-*-*)
513 syscall_dir=syscalls
514 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
a170abec 515# If newlib is supplying syscalls, select which debug protocol is being used.
8a0efa53
CF
516# ARM_RDP_MONITOR selects the Demon monitor.
517# ARM_RDI_MONITOR selects the Angel monitor.
518# If neither are defined, then hard coded defaults will be used
519# to create the program's environment.
a170abec
JJ
520# If --disable-newlib-supplied-syscalls is specified, then the end-user
521# may specify the protocol via gcc spec files supplied by libgloss.
8a0efa53 522# See also thumb below.
a170abec
JJ
523 if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
524# newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
525 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
526 fi
8a0efa53 527 ;;
859c94e8
JJ
528 arc*)
529 newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED"
530 ;;
4634da64
JJ
531 avr*)
532 newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
533 ;;
1815fdea 534 cris-*-* | crisv32-*-*)
1c74754f 535 default_newlib_io_long_long="yes"
333eabc6 536 newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DHAVE_GETTIMEOFDAY -D_USE_WRITE -DCOMPACT_CTYPE"
1815fdea
JJ
537 syscall_dir=syscalls
538 ;;
1185687a 539 crx-*-*)
fcfb0117 540 newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DMISSING_SYSCALL_NAMES"
1185687a
JJ
541 syscall_dir=
542 ;;
8a0efa53
CF
543 d10v*)
544 newlib_cflags="${newlib_cflags} -DSMALL_MEMORY"
545 syscall_dir=syscalls
546 ;;
547 d30v*)
548 newlib_cflags="${newlib_cflags} -DABORT_MESSAGE -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
549 syscall_dir=
550 ;;
bac50d6b
NC
551 ep9312-*-*)
552 syscall_dir=syscalls
553 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
a170abec
JJ
554 if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
555 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
556 fi
bac50d6b 557 ;;
8a0efa53 558 fr30-*-*)
8a0efa53
CF
559 syscall_dir=syscalls
560 ;;
bac50d6b
NC
561 frv-*-*)
562 syscall_dir=syscalls
227e6ef6 563 default_newlib_io_long_long="yes"
bac50d6b 564 ;;
8a0efa53
CF
565 h8300*-*-*)
566 syscall_dir=syscalls
63b9dcc4 567 default_newlib_io_long_long="yes"
8a0efa53 568 newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
e65d559e
JJ
569 # Simulator only extensions for H8300.
570 # Uncomment the next line to enable them.
571 # newlib_cflags="${newlib_cflags} -D__SIMULATOR__"
8a0efa53
CF
572 ;;
573 h8500-*-*)
574 syscall_dir=syscalls
575 newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
576 ;;
102861c9 577 i[34567]86-*-sco*)
3a8fc0e4 578 newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED -DHAVE_FCNTL"
8a0efa53 579 ;;
102861c9 580 i[34567]86-*-netware*)
3a8fc0e4 581 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC -DABORT_PROVIDED -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DHAVE_FCNTL"
8a0efa53 582 ;;
bfdfd7e6 583 iq2000*)
5a74f2aa 584 syscall_dir=syscalls
227e6ef6 585 default_newlib_io_long_long="yes"
5a74f2aa 586 ;;
8a0efa53
CF
587 m32r-*-*)
588 # Pass -msdata=sdata so _impure_ptr goes in .sdata.
589 # We don't generate sda relocs however for upward compatibility.
590 # FIXME: This is necessary because the default multilib doesn't
591 # use --print-multi-lib.
592 newlib_cflags="${newlib_cflags} -msdata=sdata"
593 syscall_dir=syscalls
594 ;;
a703e0f2 595 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
8d9112f2
TF
596 newlib_cflags="${newlib_cflags} -DNO_EXEC -DABORT_PROVIDED -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
597 ;;
8a0efa53 598 mcore-*-*)
8a0efa53
CF
599 syscall_dir=syscalls
600 ;;
b3934ab3 601 mips64vr*-*-*)
227e6ef6
JJ
602 default_newlib_io_long_long="yes"
603 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
b3934ab3 604 ;;
2bc257e3
JJ
605 mips*-*-elf*)
606 default_newlib_io_long_long="yes"
607 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
608 ;;
8be9b48b
JJ
609 mmix-*)
610 syscall_dir=syscalls
611 # We need every symbol 32-bit aligned, so the invalid
612 # construct with attribute ((alias ("_ctype_b+127"))) breaks.
613 newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
614 ;;
8a0efa53
CF
615 mn10?00-*-*)
616 syscall_dir=syscalls
617 ;;
0d844014 618 powerpc*-*-eabialtivec*)
227e6ef6
JJ
619 default_newlib_io_long_long="yes"
620 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
0d844014 621 ;;
936b520f 622 powerpc*-*-eabispe*)
227e6ef6
JJ
623 default_newlib_io_long_long="yes"
624 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
936b520f 625 ;;
8a0efa53
CF
626 powerpc*-*-eabi* | \
627 powerpc*-*-elf* | \
628 powerpc*-*-linux* | \
629 powerpc*-*-rtem* | \
630 powerpc*-*-sysv* | \
631 powerpc*-*-solaris*)
227e6ef6
JJ
632 default_newlib_io_long_long="yes"
633 newlib_cflags="${newlib_cflags} -mrelocatable-lib -mno-eabi -mstrict-align -DMISSING_SYSCALL_NAMES"
8a0efa53
CF
634 ;;
635 powerpcle-*-pe)
3a8fc0e4 636 newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DHAVE_FCNTL"
8a0efa53
CF
637 syscall_dir=syscalls
638 ;;
639 sh*-*-*)
227e6ef6
JJ
640 default_newlib_io_long_long="yes"
641 newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY"
8a0efa53
CF
642 syscall_dir=syscalls
643 ;;
644 sparc-sun-sunos*)
645 newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED"
646 ;;
647 sparc64-*-*)
3a8fc0e4 648 newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_BLKSIZE -DHAVE_GETTIMEOFDAY -DHAVE_FCNTL"
8a0efa53
CF
649 # This either belongs elsewhere or nowhere. But I need *something*,
650 # so for now it's here ...
651 case "${host_os}" in
652 aoutv8 | *32p)
653 newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=32" ;;
654 *)
655 newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=64" ;;
656 esac
657 ;;
658 strongarm-*-*)
659 syscall_dir=syscalls
660 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
0ffc3b94 661 ;;
8a0efa53
CF
662 thumb-*-pe)
663 syscall_dir=syscalls
664 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
665# Don't use the debugging protocols just yet.
666 ;;
667 thumb-*-*)
668 syscall_dir=syscalls
669 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
a170abec 670# If newlib is supplying syscalls, select which debug protocol is being used.
8a0efa53
CF
671# ARM_RDP_MONITOR selects the Demon monitor.
672# ARM_RDI_MONITOR selects the Angel monitor.
673# If neither are defined, then hard coded defaults will be used
674# to create the program's environment.
a170abec
JJ
675# If --disable-newlib-supplied-syscalls is specified, then the end-user
676# may specify the protocol via gcc spec files supplied by libgloss.
677 if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
678# newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
679 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
680 fi
8a0efa53
CF
681 ;;
682 tic80*)
683 syscall_dir=syscalls
684 ;;
685 v850-*-*)
686 syscall_dir=syscalls
687 ;;
688 v850e-*-*)
689 syscall_dir=syscalls
690 ;;
691 v850ea-*-*)
692 syscall_dir=syscalls
693 ;;
694 w65-*-*)
695 syscall_dir=syscalls
696 newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
697 ;;
a170abec
JJ
698 xscale-*-*)
699 syscall_dir=syscalls
700 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
701 newlib_cflags="${newlib_cflags} -DHAVE_SYSTEM -DHAVE_RENAME"
702 if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
703 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
704 fi
705 ;;
f6eff1c0 706 xstormy16-*-*)
bfc27bae
TF
707 newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY"
708 syscall_dir=syscalls
709 ;;
8a0efa53
CF
710 z8k-*-*)
711 syscall_dir=syscalls
712 ;;
713 *)
714 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
715 syscall_dir=
716 ;;
717esac
227e6ef6
JJ
718
719# Use defaults for certain settings if not specified by user
720
721# Enable long long support in I/O routines if requested.
722if [ "x${newlib_io_long_long}" = "x" ]; then
723 if [ ${default_newlib_io_long_long} = "yes" ]; then
724 newlib_io_long_long="yes";
725 fi
726fi
727
728# Enable long double support in I/O routines if requested.
729if [ "x${newlib_io_long_double}" = "x" ]; then
730 if [ ${default_newlib_io_long_double} = "yes" ]; then
731 newlib_io_long_double="yes";
732 fi
733fi
734
735# Enable printf positional argument support if requested.
736if [ "x${newlib_io_pos_args}" = "x" ]; then
737 if [ ${default_newlib_io_pos_args} = "yes" ]; then
738 newlib_io_pos_args="yes";
739 fi
740fi
45c8bb8f 741
ce93dfe4
MM
742# Disable atexit dynamic allocation if requested.
743if [ "x${newlib_atexit_dynamic_alloc}" = "x" ]; then
744 if [ ${default_newlib_atexit_dynamic_alloc} = "yes" ]; then
745 newlib_atexit_dynamic_alloc="yes";
746 fi
747fi
748
45c8bb8f
JJ
749if test -z "${have_crt0}" && test -n "${sys_dir}"; then
750 have_crt0="yes"
751fi
This page took 0.389759 seconds and 5 git commands to generate.