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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [configure.host] - Blame information for rev 56

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

powered by: WebSVN 2.1.0

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