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