]> sourceware.org Git - newlib-cygwin.git/blob - newlib/configure.host
* configure.host (mips64vr-elf, mips64vrel-elf): New config.
[newlib-cygwin.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
28 # It sets the following shell variables:
29 # newlib_cflags Special CFLAGS to use when building
30 # machine_dir Subdirectory of libc/machine to configure
31 # sys_dir Subdirectory of libc/sys to configure
32 # have_sys_mach_dir Is there a machine subdirectory in sys subdirectory
33 # posix_dir "posix" to build libc/posix, "" otherwise
34 # signal_dir "signal" to build libc/signal, "" otherwise
35 # stdio64_dir "stdio64" to build libc/stdio64, "" otherwise
36 # syscall_dir "syscalls" to build libc/syscalls, "" otherwise
37 # unix_dir "unix" to build libc/unix, "" otherwise
38 # use_libtool flag: use libtool to build newlib?
39 # aext library extension - needed for libtool support
40 # oext object file extension - needed for libtool support
41 # crt1 name of crt1 object if one is provided
42 # crt1_dir directory where crt1 object is found
43
44 newlib_cflags=
45 libm_machine_dir=
46 machine_dir=
47 sys_dir=
48 posix_dir=
49 signal_dir=signal
50 stdio64_dir=
51 syscall_dir=
52 unix_dir=
53 mach_add_setjmp=
54 crt1=
55 crt1_dir=
56 use_libtool=no
57 have_sys_mach_dir=no
58 aext=a
59 oext=o
60
61 case "${target_optspace}:${host}" in
62 yes:*)
63 newlib_cflags="${newlib_cflags} -Os"
64 ;;
65 :m32r-* | :d10v-* | :d30v-* | :avr-*)
66 newlib_cflags="${newlib_cflags} -Os"
67 ;;
68 no:* | :*)
69 newlib_cflags="${newlib_cflags} -O2"
70 ;;
71 esac
72
73 # Get the source directories to use for the CPU type.
74 # machine_dir should supply CPU dependent routines, such as setjmp.
75 # newlib_cflags is passed to gcc when compiling.
76 # THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
77
78 case "${host_cpu}" in
79 a29k)
80 machine_dir=a29k
81 ;;
82 arc)
83 machine_dir=
84 ;;
85 arm)
86 machine_dir=arm
87 ;;
88 avr*)
89 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mcall-prologues"
90 ;;
91
92 d10v*)
93 machine_dir=d10v
94 ;;
95 d30v*)
96 machine_dir=d30v
97 ;;
98 fr30)
99 machine_dir=fr30
100 ;;
101 h8300)
102 machine_dir=h8300
103 ;;
104 h8500)
105 machine_dir=h8500
106 ;;
107 hppa*)
108 machine_dir=hppa
109 ;;
110 i960)
111 machine_dir=i960
112 ;;
113 i[3456]86)
114 # Don't use for these since they provide their own setjmp.
115 case ${host} in
116 *-*-sco* | *-*-cygwin*)
117 libm_machine_dir=i386
118 machine_dir=i386
119 ;;
120 *)
121 libm_machine_dir=i386
122 machine_dir=i386
123 mach_add_setjmp=true
124 ;;
125 esac
126 ;;
127 ia64*)
128 ;;
129 m32r*)
130 machine_dir=m32r
131 ;;
132
133 m68hc11|m6811|m68hc12|m6812)
134 machine_dir=m68hc11
135 newlib_cflags="-DPREFER_SIZE_OVER_SPEED -Os -mrelax"
136 CFLAGS="-g -Os"
137 ;;
138
139 m68*)
140 machine_dir=m68k
141 newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
142 ;;
143 m88k)
144 machine_dir=m88k
145 newlib_cflags="${newlib_cflags} -m88000"
146 ;;
147 m88110)
148 machine_dir=m88k
149 newlib_cflags="${newlib_cflags} -m88110"
150 ;;
151 mcore)
152 ;;
153 mips*)
154 machine_dir=mips
155 ;;
156 mmix)
157 ;;
158 mn10200)
159 machine_dir=mn10200
160 ;;
161 mn10300)
162 machine_dir=mn10300
163 ;;
164 or16)
165 ;;
166 or32)
167 ;;
168 powerpc*)
169 machine_dir=powerpc
170 ;;
171 sh | sh64)
172 machine_dir=sh
173 ;;
174 sparc*)
175 machine_dir=sparc
176 # FIXME: Might wish to make MALLOC_ALIGNMENT more generic.
177 newlib_cflags="${newlib_cflags} -DMALLOC_ALIGNMENT=8"
178 ;;
179 strongarm)
180 machine_dir=arm
181 ;;
182 xscale)
183 machine_dir=xscale
184 ;;
185 thumb)
186 machine_dir=arm
187 ;;
188 tic80*)
189 machine_dir=tic80
190 ;;
191 v70)
192 ;;
193 v810)
194 ;;
195 v850)
196 machine_dir=v850
197 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 "
198 ;;
199 v850e)
200 machine_dir=v850
201 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 "
202 ;;
203 v850ea)
204 machine_dir=v850
205 newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 "
206 ;;
207 frv)
208 machine_dir=frv
209 ;;
210 w65*)
211 machine_dir=w65
212 ;;
213 xstormy16)
214 machine_dir=xstormy16
215 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED"
216 ;;
217 z8k)
218 machine_dir=z8k
219 ;;
220 *)
221 echo '***' "Newlib does not support CPU ${host_cpu}" 1>&2
222 exit 1
223 ;;
224 esac
225
226 # Disable thread support if requested.
227
228 if [ "${newlib_multithread}" = "no" ] ; then
229 newlib_cflags="${newlib_cflags} -D__SINGLE_THREAD__"
230 fi
231
232 # Enable multibyte support if requested or it is defaulted
233 # for target.
234
235 if [ "x${newlib_mb}" = "x" ]; then
236 case "${host}" in
237 i[3456]86-pc-linux-*|*-*-cygwin*)
238 newlib_mb=yes
239 ;;
240 esac
241 fi
242
243 if [ "x${newlib_mb}" = "xyes" ] ; then
244 newlib_cflags="${newlib_cflags} -DMB_CAPABLE"
245 fi
246
247 # Disable printf/scanf floating-point support if requested.
248
249 if [ "${newlib_io_float}" = "no" ] ; then
250 newlib_cflags="${newlib_cflags} -DNO_FLOATING_POINT"
251 fi
252
253 # Enable printf positional argument support if requested.
254
255 if [ "${newlib_io_pos_args}" = "yes" ] ; then
256 newlib_cflags="${newlib_cflags} -DWANT_IO_POS_ARGS"
257 fi
258
259 # Verify if shared newlib support is allowed and set appropriate variables
260 # We don't want to use libtool for platforms that we are not going to
261 # support shared libraries. This is because it adds executable tests which
262 # we don't want for most embedded platforms.
263 case "${host}" in
264 i[3456]86-pc-linux-*)
265 use_libtool=yes
266 have_sys_mach_dir=yes
267 stdio64_dir=stdio64
268 oext=lo
269 aext=la ;;
270 *) ;; #shared library not supported for ${host}
271 esac
272
273 # Get the source directories to use for the host. unix_dir is set
274 # to unix to get some standard Unix routines. posix_dir is set to get some
275 # standard Posix routines. sys_dir should supply system dependent routines
276 # including crt0.
277 # THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
278
279 case "${host}" in
280 *-*-cygwin*)
281 sys_dir=cygwin
282 posix_dir=posix
283 ;;
284 *-*-netware*)
285 signal_dir=
286 sys_dir=netware
287 ;;
288 *-*-rtems*) # generic RTEMS support
289 sys_dir=rtems
290 # RTEMS POSIX support is all inside RTEMS
291 ;;
292 a29k-*-*)
293 sys_dir=a29khif
294 signal_dir=
295 ;;
296 arc-*-*)
297 sys_dir=arc
298 ;;
299 arm-*-*)
300 sys_dir=arm
301 ;;
302 d10v*)
303 sys_dir=d10v
304 ;;
305 d30v*)
306 sys_dir=
307 ;;
308 h8300-*-hms*)
309 sys_dir=h8300hms
310 ;;
311 h8300-*-elf*)
312 sys_dir=h8300hms
313 ;;
314 h8300-*-coff*)
315 sys_dir=h8300hms
316 ;;
317 h8300-*-xray*)
318 sys_dir=h8300xray
319 ;;
320 h8500-*-hms*)
321 sys_dir=h8500hms
322 ;;
323 h8500-*-elf*)
324 sys_dir=h8500hms
325 ;;
326 i[3456]86-*-sco*)
327 sys_dir=sysvi386
328 unix_dir=unix
329 ;;
330 i[3456]86-pc-linux-*)
331 sys_dir=linux
332 unix_dir=unix
333 posix_dir=posix
334 crt1=crt1.o
335 crt1_dir=libc/sys/${sys_dir}
336 gcc_dir=`gcc -print-search-dirs | awk '/^install:/{print $2}'`
337 #newlib_cflags="${newlib_cflags} -Werror" # DEBUGGING ONLY;BREAKS BUILD
338 newlib_cflags="${newlib_cflags} -Wall"
339 newlib_cflags="${newlib_cflags} -D_I386MACH_ALLOW_HW_INTERRUPTS"
340 newlib_cflags="${newlib_cflags} -D_LOOSE_KERNEL_NAMES -DHAVE_FCNTL"
341 newlib_cflags="${newlib_cflags} -DWANT_IO_POS_ARGS -DWANT_IO_LONG_DBL"
342 # --- Required when building a shared library ------------------------
343 newlib_cflags="${newlib_cflags} -fPIC -D_I386MACH_NEED_SOTYPE_FUNCTION"
344 # --- The three lines below are optional ------------------------------
345 ##newlib_cflags="${newlib_cflags} -nostdinc"
346 ##newlib_cflags="${newlib_cflags} -I`newlib-flags --kernel-dir`/include"
347 ##newlib_cflags="${newlib_cflags} -idirafter ${gcc_dir}include"
348 ;;
349
350 m68hc11-*-*|m6811-*-*|m6812-*-*|m68hc12-*-*)
351 ;;
352
353 m68k-sun-sunos*)
354 unix_dir=unix
355 ;;
356 m8*-bug-*)
357 sys_dir=m88kbug
358 ;;
359 mips*-dec-*)
360 sys_dir=decstation
361 ;;
362 mmix-knuth-mmixware)
363 sys_dir=mmixware
364 ;;
365 powerpcle-*-pe)
366 sys_dir=cygwin
367 posix_dir=posix
368 ;;
369 sh*-*)
370 sys_dir=sh
371 ;;
372 sparc-sun-sunos*)
373 sys_dir=sun4
374 unix_dir=unix
375 ;;
376 sparc64*)
377 sys_dir=sparc64
378 unix_dir=unix
379 ;;
380 strongarm-*-*)
381 sys_dir=arm
382 ;;
383 xscale-*-*)
384 sys_dir=arm
385 ;;
386 thumb-*-*)
387 sys_dir=arm
388 ;;
389 tic80*)
390 sys_dir=tic80
391 ;;
392 v70-nec-*)
393 sys_dir=sysvnecv70
394 ;;
395 v810-*-*)
396 sys_dir=sysnec810
397 ;;
398 v850-*-*)
399 sys_dir=sysnecv850
400 ;;
401 v850e-*-*)
402 sys_dir=sysnecv850
403 ;;
404 v850ea-*-*)
405 sys_dir=sysnecv850
406 ;;
407 frv*)
408 sys_dir=
409 ;;
410 w65-*-*)
411 sys_dir=w65
412 ;;
413 z8k-*-coff)
414 sys_dir=z8ksim
415 ;;
416 esac
417
418 # Host specific flag settings -- usually for features that are not
419 # general enough or broad enough to be handled above.
420 # THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
421
422 case "${host}" in
423 *-*-cygwin*)
424 newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -DWANT_IO_LONG_DBL -DWANT_PRINTF_LONG_LONG -D_COMPILING_NEWLIB -DHAVE_FCNTL -DMALLOC_PROVIDED"
425 syscall_dir=syscalls
426 ;;
427 # RTEMS supplies its own versions of some routines:
428 # malloc() (reentrant version)
429 # exit() RTEMS has a "global" reent to flush
430 # signal()/raise() RTEMS has its own including pthread signals
431 # _XYZ_r() RTEMS has its own reentrant routines
432 #
433 # NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
434 *-*-rtems*)
435 newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DWANT_PRINTF_LONG_LONG -DHAVE_FCNTL"
436 ;;
437 # VxWorks supplies its own version of malloc, and the newlib one
438 # doesn't work because VxWorks does not have sbrk.
439 *-wrs-vxworks*)
440 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -DHAVE_FCNTL"
441 ;;
442 # UDI doesn't have exec, so system() should fail the right way
443 a29k-amd-udi)
444 newlib_cflags="${newlib_cflags} -DNO_EXEC"
445 syscall_dir=syscalls
446 ;;
447 arc-*-*)
448 syscall_dir=syscalls
449 ;;
450 arm-*-pe)
451 syscall_dir=syscalls
452 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
453 # Don't use the debugging protocols just yet.
454 ;;
455 arm-*-*)
456 syscall_dir=syscalls
457 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
458 # Select which debug protocol is being used.
459 # ARM_RDP_MONITOR selects the Demon monitor.
460 # ARM_RDI_MONITOR selects the Angel monitor.
461 # If neither are defined, then hard coded defaults will be used
462 # to create the program's environment.
463 # See also thumb below.
464 # newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
465 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
466 ;;
467 avr*)
468 newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
469 ;;
470 d10v*)
471 newlib_cflags="${newlib_cflags} -DSMALL_MEMORY"
472 syscall_dir=syscalls
473 ;;
474 d30v*)
475 newlib_cflags="${newlib_cflags} -DABORT_MESSAGE -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
476 syscall_dir=
477 ;;
478 fr30-*-*)
479 newlib_cflags="${newlib_cflags}"
480 syscall_dir=syscalls
481 ;;
482 h8300*-*-*)
483 syscall_dir=syscalls
484 newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
485 ;;
486 h8500-*-*)
487 syscall_dir=syscalls
488 newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
489 ;;
490 i[3456]86-*-sco*)
491 newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED -DHAVE_FCNTL"
492 ;;
493 i[3456]86-*-netware*)
494 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC -DABORT_PROVIDED -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DHAVE_FCNTL"
495 ;;
496 m32r-*-*)
497 # Pass -msdata=sdata so _impure_ptr goes in .sdata.
498 # We don't generate sda relocs however for upward compatibility.
499 # FIXME: This is necessary because the default multilib doesn't
500 # use --print-multi-lib.
501 newlib_cflags="${newlib_cflags} -msdata=sdata"
502 syscall_dir=syscalls
503 ;;
504 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
505 newlib_cflags="${newlib_cflags} -DNO_EXEC -DABORT_PROVIDED -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
506 ;;
507 mcore-*-*)
508 newlib_cflags="${newlib_cflags}"
509 syscall_dir=syscalls
510 ;;
511 mips64vr*-*-*)
512 newlib_cflags="${newlib_cflags} -DWANT_PRINTF_LONG_LONG -DMISSING_SYSCALL_NAMES"
513 ;;
514 mmix-*)
515 syscall_dir=syscalls
516 # We need every symbol 32-bit aligned, so the invalid
517 # construct with attribute ((alias ("_ctype_b+127"))) breaks.
518 newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
519 ;;
520 mn10?00-*-*)
521 syscall_dir=syscalls
522 ;;
523 powerpc*-*-eabialtivec*)
524 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DWANT_PRINTF_LONG_LONG"
525 ;;
526 powerpc*-*-eabispe*)
527 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DWANT_PRINTF_LONG_LONG"
528 ;;
529 powerpc*-*-eabi* | \
530 powerpc*-*-elf* | \
531 powerpc*-*-linux* | \
532 powerpc*-*-rtem* | \
533 powerpc*-*-sysv* | \
534 powerpc*-*-solaris*)
535 newlib_cflags="${newlib_cflags} -mrelocatable-lib -mno-eabi -mstrict-align -DMISSING_SYSCALL_NAMES -DWANT_PRINTF_LONG_LONG"
536 ;;
537 powerpcle-*-pe)
538 newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DHAVE_FCNTL"
539 syscall_dir=syscalls
540 ;;
541 sh*-*-*)
542 newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY -DWANT_PRINTF_LONG_LONG"
543 syscall_dir=syscalls
544 ;;
545 sparc-sun-sunos*)
546 newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED"
547 ;;
548 sparc64-*-*)
549 newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_BLKSIZE -DHAVE_GETTIMEOFDAY -DHAVE_FCNTL"
550 # This either belongs elsewhere or nowhere. But I need *something*,
551 # so for now it's here ...
552 case "${host_os}" in
553 aoutv8 | *32p)
554 newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=32" ;;
555 *)
556 newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=64" ;;
557 esac
558 ;;
559 strongarm-*-*)
560 syscall_dir=syscalls
561 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
562 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
563 ;;
564 xscale-*-*)
565 syscall_dir=syscalls
566 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
567 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
568 newlib_cflags="${newlib_cflags} -DHAVE_SYSTEM -DHAVE_RENAME"
569 ;;
570 thumb-*-pe)
571 syscall_dir=syscalls
572 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
573 # Don't use the debugging protocols just yet.
574 ;;
575 thumb-*-*)
576 syscall_dir=syscalls
577 newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
578 # Select which debug protocol is being used.
579 # ARM_RDP_MONITOR selects the Demon monitor.
580 # ARM_RDI_MONITOR selects the Angel monitor.
581 # If neither are defined, then hard coded defaults will be used
582 # to create the program's environment.
583 # See also arm and strongarm above.
584 # newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
585 newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
586 ;;
587 tic80*)
588 syscall_dir=syscalls
589 ;;
590 v850-*-*)
591 syscall_dir=syscalls
592 ;;
593 v850e-*-*)
594 syscall_dir=syscalls
595 ;;
596 v850ea-*-*)
597 syscall_dir=syscalls
598 ;;
599 frv-*-*)
600 syscall_dir=syscalls
601 newlib_cflags="${newlib_cflags} -DWANT_PRINTF_LONG_LONG"
602 ;;
603 w65-*-*)
604 syscall_dir=syscalls
605 newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
606 ;;
607 xstormy16-*-*)
608 newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY"
609 syscall_dir=syscalls
610 ;;
611 z8k-*-*)
612 syscall_dir=syscalls
613 ;;
614 *)
615 newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
616 syscall_dir=
617 ;;
618 esac
This page took 0.067201 seconds and 6 git commands to generate.