OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [configure.host] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 joel
# 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
 
26
# It sets the following shell variables:
27
#   newlib_cflags       Special CFLAGS to use when building
28
#   machine_dir         Subdirectory of libc/machine to configure
29
#   sys_dir             Subdirectory of libc/sys to configure
30
#   posix_dir           "posix" to build libc/posix, "" otherwise
31
#   signal_dir          "signal" to build libc/signal, "" otherwise
32
#   syscall_dir         "syscalls" to build libc/syscalls, "" otherwise
33
#   unix_dir            "unix" to build libc/unix, "" otherwise
34
 
35
newlib_cflags=
36
machine_dir=
37
sys_dir=
38
posix_dir=
39
signal_dir=signal
40
syscall_dir=
41
unix_dir=
42
mach_add_setjmp=
43
 
44
case "${target_optspace}:${host}" in
45
  yes:*)
46
    newlib_cflags="${newlib_cflags} -Os"
47
    ;;
48
  :m32r-* | :d10v-* | :d30v-*)
49
    newlib_cflags="${newlib_cflags} -Os"
50
    ;;
51
  no:* | :*)
52
    newlib_cflags="${newlib_cflags} -O2"
53
    ;;
54
esac
55
 
56
# Get the source directories to use for the CPU type.
57
# machine_dir should supply CPU dependent routines, such as setjmp.
58
# newlib_cflags is passed to gcc when compiling.
59
# THIS TABLE IS ALPHA SORTED.  KEEP IT THAT WAY.
60
 
61
case "${host_cpu}" in
62
  a29k)
63
        machine_dir=a29k
64
        ;;
65
  arc)
66
        machine_dir=
67
        ;;
68
  arm)
69
        machine_dir=arm
70
        ;;
71
  d10v*)
72
        machine_dir=d10v
73
        ;;
74
  d30v*)
75
        machine_dir=d30v
76
        ;;
77
  fr30)
78
        machine_dir=fr30
79
        ;;
80
  h8300)
81
        machine_dir=h8300
82
        ;;
83
  h8500)
84
        machine_dir=h8500
85
        ;;
86
  hppa*)
87
        machine_dir=hppa
88
        ;;
89
  i960)
90
        machine_dir=i960
91
        ;;
92
  i[3456]86)
93
        # Don't use for these since they provide their own setjmp.
94
        case ${host} in
95
        *-*-go32 | *-*-sco* | *-*-cygwin*)
96
                machine_dir=i386
97
                ;;
98
        *)
99
                machine_dir=i386
100
                mach_add_setjmp=true
101
                ;;
102
        esac
103
        ;;
104
  m32r*)
105
        machine_dir=m32r
106
        ;;
107
  m68*)
108
        machine_dir=m68k
109
        ;;
110
  m88k)
111
        machine_dir=m88k
112
        newlib_cflags="${newlib_cflags} -m88000"
113
        ;;
114
  m88110)
115
        machine_dir=m88k
116
        newlib_cflags="${newlib_cflags} -m88110"
117
        ;;
118
  mcore)
119
        ;;
120
  mips*)
121
        machine_dir=mips
122
        ;;
123
  mn10200)
124
        machine_dir=mn10200
125
        ;;
126
  mn10300)
127
        machine_dir=mn10300
128
        ;;
129 59 joel
  or16)
130
        ;;
131
  or32)
132
        ;;
133 56 joel
  powerpc*)
134
        machine_dir=powerpc
135
        ;;
136
  sh)
137
        machine_dir=sh
138
        ;;
139
  sparc*)
140
        machine_dir=sparc
141
        # FIXME: Might wish to make MALLOC_ALIGNMENT more generic.
142
        newlib_cflags="${newlib_cflags} -DMALLOC_ALIGNMENT=8"
143
        ;;
144
  strongarm)
145
        machine_dir=arm
146
        ;;
147
  thumb)
148
        machine_dir=arm
149
        ;;
150
  tic80*)
151
        machine_dir=tic80
152
        ;;
153
  v70)
154
        ;;
155
  v810)
156
        ;;
157
  v850)
158
        machine_dir=v850
159 59 joel
        #newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 -mno-app-regs -msmall-sld"
160
        newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850"
161 56 joel
        ;;
162
  v850e)
163
        machine_dir=v850
164 59 joel
        #newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 -mno-app-regs -msmall-sld"
165
        newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850"
166 56 joel
        ;;
167
  v850ea)
168
        machine_dir=v850
169 59 joel
        #newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 -mno-app-regs -msmall-sld"
170
        newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850"
171 56 joel
        ;;
172
  w65*)
173
        machine_dir=w65
174
        ;;
175
  z8k)
176
        machine_dir=z8k
177
        ;;
178
  *)
179
        echo '***' "Newlib does not support CPU ${host_cpu}" 1>&2
180
        exit 1
181
        ;;
182
esac
183
 
184
# Enable multibyte support if requested.
185
 
186
if [ "${newlib_mb}" = "yes" ] ; then
187
        newlib_cflags="${newlib_cflags} -DMB_CAPABLE"
188
fi
189
 
190
# Get the source directories to use for the host.  unix_dir is set
191
# to unix to get some standard Unix routines.  posix_dir is set to get some
192
# standard Posix routines.  sys_dir should supply system dependent routines
193
# including crt0.
194
# THIS TABLE IS ALPHA SORTED.  KEEP IT THAT WAY.
195
 
196
case "${host}" in
197
  *-*-cygwin*)
198
        sys_dir=cygwin
199
        posix_dir=posix
200
        ;;
201
  *-*-netware*)
202
        signal_dir=
203
        sys_dir=netware
204
        ;;
205
  *-*-rtems*)                   # generic RTEMS support
206
        sys_dir=rtems
207
        # RTEMS POSIX support is all inside RTEMS
208
        ;;
209
  a29k-*-*)
210
        sys_dir=a29khif
211
        signal_dir=
212
        ;;
213
  arc-*-*)
214
        sys_dir=arc
215
        ;;
216
  arm-*-*)
217
        sys_dir=arm
218
        ;;
219
  d10v*)
220
        sys_dir=d10v
221
        ;;
222
  d30v*)
223
        sys_dir=
224
        ;;
225
  h8300-*-hms*)
226
        sys_dir=h8300hms
227
        ;;
228
  h8300-*-xray*)
229
        sys_dir=h8300xray
230
        ;;
231
  h8500-*-hms*)
232
        sys_dir=h8500hms
233
        ;;
234
  i[3456]86-*-go32)
235
        sys_dir=go32
236
        ;;
237
  i[3456]86-*-sco*)
238
        sys_dir=sysvi386
239
        unix_dir=unix
240
        ;;
241
  m68k-sun-sunos*)
242
        unix_dir=unix
243
        ;;
244
  m8*-bug-*)
245
        sys_dir=m88kbug
246
        ;;
247
  mips*-dec-*)
248
        sys_dir=decstation
249
        ;;
250
  powerpcle-*-pe)
251
        sys_dir=cygwin
252
        posix_dir=posix
253
        ;;
254
  sh*-*)
255
        sys_dir=sh
256
        ;;
257
  sparc-sun-sunos*)
258
        sys_dir=sun4
259
        unix_dir=unix
260
        ;;
261
  sparc64*)
262
        sys_dir=sparc64
263
        unix_dir=unix
264
        ;;
265
  strongarm-*-*)
266
        sys_dir=arm
267
        ;;
268
  thumb-*-*)
269
        sys_dir=arm
270
        ;;
271
  tic80*)
272
        sys_dir=tic80
273
        ;;
274
  v70-nec-*)
275
        sys_dir=sysvnecv70
276
        ;;
277
  v810-*-*)
278
        sys_dir=sysnec810
279
        ;;
280
  v850-*-*)
281
        sys_dir=sysnecv850
282
        ;;
283
  v850e-*-*)
284
        sys_dir=sysnecv850
285
        ;;
286
  v850ea-*-*)
287
        sys_dir=sysnecv850
288
        ;;
289
  w65-*-*)
290
        sys_dir=w65
291
        ;;
292
  z8k-*-coff)
293
        sys_dir=z8ksim
294
        ;;
295
esac
296
 
297
# Host specific flag settings -- usually for features that are not
298
# general enough or broad enough to be handled above.
299
# THIS TABLE IS ALPHA SORTED.  KEEP IT THAT WAY.
300
 
301
case "${host}" in
302
  *-*-cygwin*)
303
        newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -DWANT_PRINTF_LONG_LONG -D_COMPILING_NEWLIB"
304
        syscall_dir=syscalls
305
        ;;
306
# RTEMS supplies its own versions of some routines:
307
#       malloc()            (reentrant version)
308
#       exit()              RTEMS has a "global" reent to flush
309
#       signal()/raise()    RTEMS has its own including pthread signals
310
#       _XYZ_r()            RTEMS has its own reentrant routines
311
#
312
#  NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
313
  *-*-rtems*)
314
        newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR"
315
        ;;
316
# VxWorks supplies its own version of malloc, and the newlib one
317
# doesn't work because VxWorks does not have sbrk.
318
  *-wrs-vxworks*)
319
        newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES"
320
        ;;
321
# UDI doesn't have exec, so system() should fail the right way
322
  a29k-amd-udi)
323
        newlib_cflags="${newlib_cflags} -DNO_EXEC"
324
        syscall_dir=syscalls
325
        ;;
326
  arc-*-*)
327
        syscall_dir=syscalls
328
        ;;
329
  arm-*-pe)
330
        syscall_dir=syscalls
331
        newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
332
# Don't use the debugging protocols just yet.
333
        ;;
334
  arm-*-*)
335
        syscall_dir=syscalls
336
        newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
337
# Select which debug protocol is being used.
338
# ARM_RDP_MONITOR selects the Demon monitor.
339
# ARM_RDI_MONITOR selects the Angel monitor.
340
# If neither are defined, then hard coded defaults will be used
341
# to create the program's environment.
342
# See also thumb below.
343
#       newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
344
        newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
345
        ;;
346
  d10v*)
347
        newlib_cflags="${newlib_cflags} -DSMALL_MEMORY"
348
        syscall_dir=syscalls
349
        ;;
350
  d30v*)
351
        newlib_cflags="${newlib_cflags} -DABORT_MESSAGE -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
352
        syscall_dir=
353
        ;;
354
  fr30-*-*)
355
        newlib_cflags="${newlib_cflags}"
356
        syscall_dir=syscalls
357
        ;;
358
  h8300*-*-*)
359
        syscall_dir=syscalls
360
        newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
361
        ;;
362
  h8500-*-*)
363
        syscall_dir=syscalls
364
        newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
365
        ;;
366
  i[3456]86-*-sco*)
367
        newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED"
368
        ;;
369
  i[3456]86-*-netware*)
370
        newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC -DABORT_PROVIDED -DCLOCK_PROVIDED -DMALLOC_PROVIDED"
371
        ;;
372
  i[3456]86-*-go32)
373
        newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC"
374
        ;;
375
  m32r-*-*)
376
        # Pass -msdata=sdata so _impure_ptr goes in .sdata.
377
        # We don't generate sda relocs however for upward compatibility.
378
        # FIXME: This is necessary because the default multilib doesn't
379
        # use --print-multi-lib.
380
        newlib_cflags="${newlib_cflags} -msdata=sdata"
381
        syscall_dir=syscalls
382
        ;;
383
  mcore-*-*)
384
        newlib_cflags="${newlib_cflags}"
385
        syscall_dir=syscalls
386
        ;;
387
  mn10?00-*-*)
388
        syscall_dir=syscalls
389
        ;;
390
  powerpc*-*-eabi* | \
391
  powerpc*-*-elf* | \
392
  powerpc*-*-linux* | \
393
  powerpc*-*-rtem* | \
394
  powerpc*-*-sysv* | \
395
  powerpc*-*-solaris*)
396
        newlib_cflags="${newlib_cflags} -mrelocatable-lib -mno-eabi -mstrict-align -DMISSING_SYSCALL_NAMES"
397
        ;;
398
  powerpcle-*-pe)
399
        newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME"
400
        syscall_dir=syscalls
401
        ;;
402
  sh*-*-*)
403
        syscall_dir=syscalls
404
        ;;
405
  sparc-sun-sunos*)
406
        newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED"
407
        ;;
408
  sparc64-*-*)
409
        newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_BLKSIZE -DHAVE_GETTIMEOFDAY"
410
        # This either belongs elsewhere or nowhere. But I need *something*,
411
        # so for now it's here ...
412
        case "${host_os}" in
413
          aoutv8 | *32p)
414
                newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=32" ;;
415
          *)
416
                newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=64" ;;
417
        esac
418
        ;;
419
  strongarm-*-*)
420
        syscall_dir=syscalls
421
        newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
422
        newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
423
        ;;
424
  thumb-*-pe)
425
        syscall_dir=syscalls
426
        newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
427
# Don't use the debugging protocols just yet.
428
        ;;
429
  thumb-*-*)
430
        syscall_dir=syscalls
431
        newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
432
# Select which debug protocol is being used.
433
# ARM_RDP_MONITOR selects the Demon monitor.
434
# ARM_RDI_MONITOR selects the Angel monitor.
435
# If neither are defined, then hard coded defaults will be used
436
# to create the program's environment.
437
# See also arm and strongarm above.
438
#       newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
439
        newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
440
        ;;
441
  tic80*)
442
        syscall_dir=syscalls
443
        ;;
444
  v850-*-*)
445
        syscall_dir=syscalls
446
        ;;
447
  v850e-*-*)
448
        syscall_dir=syscalls
449
        ;;
450
  v850ea-*-*)
451
        syscall_dir=syscalls
452
        ;;
453
  w65-*-*)
454
        syscall_dir=syscalls
455
        newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
456
        ;;
457
  z8k-*-*)
458
        syscall_dir=syscalls
459
        ;;
460
  *)
461
        newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
462
        syscall_dir=
463
        ;;
464
esac

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.