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