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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [configure.in] - Blame information for rev 39

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
# This file is a shell script fragment that supplies the information
2
# necessary to tailor a template configure script into the configure
3
# script appropriate for this directory.  For more information, check
4
# any existing configure script.
5
 
6
# We need multilib support.
7
# For now default to enabled.
8
if [ "${enable_multilib}" = "" ]; then
9
        enable_multilib=yes
10
fi
11
 
12
srctrigger=Makefile.in
13
srcname="libc"
14
target_dependent=true
15
 
16
# newlib is configured for a particular target.  It must be built with
17
# a build environment providing tools for that target.  This means
18
# that "configure sun4 -target vxworks68" will build a library which
19
# can be used on vxworks68; the sun4 is essentially ignored, and there
20
# must be a build environment which will generate vxworks68 tools.  A
21
# simple "configure sun4" will build a library which can be used on a
22
# sun4.
23
 
24
# Unfortunately, newlib does have one program which must run on the
25
# host, namely makedoc, which is used to build documentation.
26
 
27
# newlib does not test any features of the build environment (the
28
# host).  It needs cc, as, ar, and ranlib for the target.
29
 
30
if [ -z "${with_multisubdir}" ]; then
31
  configdirs="doc"
32
fi
33
 
34
# per-host:
35
 
36
# This is basically a hack so that we don't have to replicate the same
37
# defines in all the Makefiles.  We put a standard set of definitions
38
# in host/any, and use them everywhere.
39
 
40
host_makefile_frag=host/any
41
 
42
# per-target:
43
 
44
newlib_target=
45
 
46
case "${enable_target_optspace}:${target}" in
47
  yes:*)
48
    target_cflags="-Os"
49
    ;;
50
  :m32r-* |  :d10v-*)
51
    target_cflags="-Os"
52
    ;;
53
  no:* | :*)
54
    target_cflags="-O2"
55
    ;;
56
  *)
57
    echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
58
    target_cflags="-O2"
59
    ;;
60
esac
61
 
62
unix_dir=
63
libc_unix_lib=
64
posix_dir=
65
libc_posix_lib=
66
signal_dir=signal
67
libc_signal_lib=
68
machine_dir=
69
libc_machine_lib=
70
sys_dir=
71
libc_sys_lib=
72
syscall_dir=
73
libc_syscall_lib=
74
 
75
files=
76
links=
77
 
78
# Get the source directories to use for the CPU type.
79
# machine_dir should supply CPU dependent routines, such as setjmp.
80
# target_cflags is passed to gcc when compiling.
81
# THIS TABLE IS SORTED.  KEEP IT THAT WAY.
82
 
83
case "${target_cpu}" in
84
  a29k)
85
        machine_dir=a29k
86
        ;;
87
  arc)
88
        machine_dir=
89
        ;;
90
  arm)
91
        machine_dir=arm
92
        ;;
93
  d10v*)
94
        machine_dir=d10v
95
        ;;
96
  h8300)
97
        machine_dir=h8300
98
        ;;
99
  h8500)
100
        machine_dir=h8500
101
        ;;
102
  hppa*)
103
        machine_dir=hppa
104
        ;;
105
  i960)
106
        machine_dir=i960
107
        ;;
108
  i[3456]86)
109
        # Don't use for these since they provide their own setjmp.
110
        case ${target} in
111
        *-*-go32 | *-*-sco* | *-*-cygwin32) machine_dir= ;;
112
        *) machine_dir=i386 ;;
113
        esac
114
        ;;
115
  m32r*)
116
        machine_dir=m32r
117
        ;;
118
  m68*)
119
        machine_dir=m68k
120
        ;;
121
  m88k)
122
        machine_dir=m88k
123
        target_cflags="-m88000"
124
        ;;
125
  m88110)
126
        machine_dir=m88k
127
        target_cflags="-m88110"
128
        ;;
129
  mips*)
130
        machine_dir=mips
131
        ;;
132
  mn10200)
133
        machine_dir=mn10200
134
        ;;
135
  mn10300)
136
        machine_dir=mn10300
137
        ;;
138
  powerpc*)
139
        machine_dir=powerpc
140
        ;;
141
  or32)
142
        machine_dir=or32
143
        ;;
144
  sh)
145
        machine_dir=sh
146
        ;;
147
  sparc*)
148
        machine_dir=sparc
149
        # FIXME: Might wish to make MALLOC_ALIGNMENT more generic.
150
        target_cflags="${target_cflags} -DMALLOC_ALIGNMENT=8"
151
        ;;
152
  thumb)
153
        machine_dir=arm
154
        ;;
155
  v70)
156
        ;;
157
  v810)
158
        ;;
159
  v850)
160
        machine_dir=v850
161
        target_cflags="-DPREFER_SIZE_OVER_SPEED -mv850 -msmall-sld -mno-app-regs"
162
        ;;
163
  w65*)
164
        fp_dir=ieeefp
165
        machine_dir=w65
166
        ;;
167
  z8k)
168
        machine_dir=z8k
169
        ;;
170
  *)
171
        echo '***' "Newlib does not support target cpu ${target_cpu}" 1>&2
172
        exit 1
173
        ;;
174
esac
175
 
176
if [ x"${enable_newlib_mb}" != x ] ; then
177
        target_cflags="${target_cflags} -DMB_CAPABLE "
178
fi
179
 
180
# Get the source directories to use for the target.  unix_dir is set
181
# to unix to get some standard Unix routines.  posix_dir is set to get some
182
# standard Posix routines.  sys_dir should supply system dependent routines
183
# including crt0.
184
# THIS TABLE IS SORTED.  KEEP IT THAT WAY.
185
 
186
case "${target}" in
187
  *-*-cygwin32)
188
        sys_dir=cygwin32
189
        posix_dir=posix
190
        ;;
191
  *-*-netware*)
192
        signal_dir=
193
        sys_dir=netware
194
        ;;
195
  *-*-rtems*)                   # generic RTEMS support
196
        sys_dir=rtems
197
        ;;
198
  a29k-*-*)
199
        sys_dir=a29khif
200
        signal_dir=
201
        ;;
202
  arc-*-*)
203
        sys_dir=arc
204
        ;;
205
  arm-*-*)
206
        sys_dir=arm
207
        ;;
208
  d10v*)
209
        sys_dir=d10v
210
        ;;
211
  h8300-*-hms*)
212
        sys_dir=h8300hms
213
        ;;
214
  h8300-*-xray*)
215
        sys_dir=h8300xray
216
        ;;
217
  h8500-*-hms*)
218
        sys_dir=h8500hms
219
        ;;
220
  i[3456]86-*-go32)
221
        sys_dir=go32
222
        ;;
223
  i[3456]86-*-sco*)
224
        sys_dir=sysvi386
225
        unix_dir=unix
226
        ;;
227
  m68k-sun-sunos*)
228
        unix_dir=unix
229
        ;;
230
  m8*-bug-*)
231
        sys_dir=m88kbug
232
        ;;
233
  mn10200-*-*)
234
        sys_dir=sysmec
235
        ;;
236
  mips*-dec-*)
237
        sys_dir=decstation
238
        ;;
239
  powerpcle-*-pe)
240
        sys_dir=cygwin32
241
        posix_dir=posix
242
        ;;
243
  sh*-*)
244
        sys_dir=sh
245
        ;;
246
  sparc-sun-sunos*)
247
        sys_dir=sun4
248
        unix_dir=unix
249
        ;;
250
  sparc64*)
251
        sys_dir=sparc64
252
        unix_dir=unix
253
        ;;
254
  thumb-*-*)
255
        sys_dir=arm
256
        ;;
257
  v70-nec-*)
258
        sys_dir=sysvnecv70
259
        ;;
260
  v810-*-*)
261
        sys_dir=sysnec810
262
        ;;
263
  v850-*-*)
264
        sys_dir=sysnecv850
265
        ;;
266
  w65-*-*)
267
        sys_dir=w65
268
        ;;
269
  z8k-*-coff)
270
        sys_dir=z8ksim
271
        ;;
272
esac
273
 
274
# Target specific flag settings -- usually for features that are not
275
# general enough or broad enough to be handled above.
276
# THIS TABLE IS SORTED.  KEEP IT THAT WAY.
277
 
278
case "${target}" in
279
  *-*-cygwin32)
280
        target_cflags="${target_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED"
281
        syscall_dir=syscalls
282
        fake_sys_dir=
283
        ;;
284
# RTEMS supplies its own versions of some routines:
285
#       malloc()            (reentrant version)
286
#       exit()              RTEMS has a "global" reent to flush
287
#       signal()/raise()    RTEMS has its own including pthread signals
288
#       _XYZ_r()            RTEMS has its own reentrant routines
289
#
290
#  NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
291
  *-*-rtems*)
292
        target_cflags="${target_cflags} -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED"
293
        ;;
294
# VxWorks supplies its own version of malloc, and the newlib one
295
# doesn't work because VxWorks does not have sbrk.
296
  *-wrs-vxworks*)
297
        target_cflags="${target_cflags} -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES"
298
        ;;
299
# UDI doesn't have exec, so system() should fail the right way
300
  a29k-amd-udi)
301
        target_cflags="${target_cflags} -DNO_EXEC"
302
        syscall_dir=syscalls
303
        ;;
304
  arc-*-*)
305
        syscall_dir=syscalls
306
        ;;
307
  arm-*-pe)
308
        syscall_dir=syscalls
309
        target_cflags="${target_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
310
# Don't use the debugging protocols just yet.
311
        ;;
312
  arm-*-*)
313
        syscall_dir=syscalls
314
        target_cflags="${target_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
315
# Select which debug protocol is being used.
316
# ARM_RDP_MONITOR selects the Demon monitor.
317
# ARM_RDI_MONITOR selects the Angel monitor.
318
# If neither are defined, then hard coded defaults will be used
319
# to create the program's environment.
320
# See also thumb target below.
321
        target_cflags="${target_cflags} -DARM_RDP_MONITOR"
322
#       target_cflags="${target_cflags} -DARM_RDI_MONITOR"
323
        ;;
324
  d10v*)
325
        target_cflags="${target_cflags} -DSMALL_MEMORY"
326
        syscall_dir=syscalls
327
        ;;
328
  h8300*-*-*)
329
        syscall_dir=syscalls
330
        target_cflags="${target_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
331
        ;;
332
  h8500-*-*)
333
        syscall_dir=syscalls
334
        target_cflags="${target_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
335
        ;;
336
  i[3456]86-*-sco*)
337
        target_cflags="${target_cflags} -DSIGNAL_PROVIDED"
338
        ;;
339
  i[3456]86-*-netware*)
340
        target_cflags="${target_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC -DABORT_PROVIDED -DCLOCK_PROVIDED -DMALLOC_PROVIDED"
341
        ;;
342
  i[3456]86-*-go32)
343
        target_cflags="${target_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC"
344
        fake_sys_dir=
345
        ;;
346
  m32r-*-*)
347
        # Pass -msdata=sdata so _impure_ptr goes in .sdata.
348
        # We don't generate sda relocs however for upward compatibility.
349
        # FIXME: This is necessary because the default multilib doesn't
350
        # use --print-multi-lib.
351
        target_cflags="${target_cflags} -msdata=sdata"
352
        syscall_dir=syscalls
353
        ;;
354
  mn10?00-*-*)
355
        syscall_dir=syscalls
356
        ;;
357
  powerpc*-*-eabi* | \
358
  powerpc*-*-elf* | \
359
  powerpc*-*-linux* | \
360
  powerpc*-*-rtem* | \
361
  powerpc*-*-sysv* | \
362
  powerpc*-*-solaris*)
363
        target_cflags="${target_cflags} -mrelocatable-lib -mno-eabi -mstrict-align -DMISSING_SYSCALL_NAMES"
364
        ;;
365
  powerpcle-*-pe)
366
        target_cflags="${target_cflags} -DHAVE_OPENDIR -DHAVE_RENAME"
367
        syscall_dir=syscalls
368
        ;;
369
  sh*-*-*)
370
        syscall_dir=syscalls
371
        ;;
372
  sparc-sun-sunos*)
373
        target_cflags="${target_cflags} -DSIGNAL_PROVIDED"
374
        ;;
375
  sparc64-*-*)
376
        target_cflags="${target_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_BLKSIZE -DHAVE_GETTIMEOFDAY"
377
        # This either belongs elsewhere or nowhere. But I need *something*,
378
        # so for now it's here ...
379
        case "${target_os}" in
380
          aoutv8 | *32p)
381
                target_cflags="${target_cflags} -DTARGET_PTR_SIZE=32" ;;
382
          *)
383
                target_cflags="${target_cflags} -DTARGET_PTR_SIZE=64" ;;
384
        esac
385
        ;;
386
  thumb-*-pe)
387
        syscall_dir=syscalls
388
        target_cflags="${target_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
389
# Don't use the debugging protocols just yet.
390
        ;;
391
  thumb-*-*)
392
        syscall_dir=syscalls
393
        target_cflags="${target_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY"
394
# Select which debug protocol is being used.
395
# ARM_RDP_MONITOR selects the Demon monitor.
396
# ARM_RDI_MONITOR selects the Angel monitor.
397
# If neither are defined, then hard coded defaults will be used
398
# to create the program's environment.
399
# See also arm target above.
400
        target_cflags="${target_cflags} -DARM_RDP_MONITOR"
401
#       target_cflags="${target_cflags} -DARM_RDI_MONITOR"
402
        ;;
403
  v850-*-*)
404
        syscall_dir=syscalls
405
        ;;
406
  w65-*-*)
407
        syscall_dir=syscalls
408
        target_cflags="${target_cflags} -DSMALL_DTOA -DSMALL_MEMORY"
409
        ;;
410
  z8k-*-*)
411
        syscall_dir=syscalls
412
        ;;
413
  *)
414
        target_cflags="${target_cflags} -DMISSING_SYSCALL_NAMES"
415
        syscall_dir=
416
        ;;
417
esac
418
 
419
# Determine subdirs based on unix_dir, posix_dir, signal_dir, machine_dir
420
# and sys_dir.  Subdirs is the list of directories whose Makefiles we edit.
421
 
422
subdirs="libc libc/ctype libc/errno libc/locale libc/misc libc/reent libc/stdio libc/stdlib libc/string libc/time libm libm/math"
423
 
424
for i in testsuite testsuite/libm.paranoia testsuite/libm.sac ; do
425
        if [ -d ${srcdir}/$i ] ; then
426
                subdirs="${subdirs} $i"
427
        fi
428
done
429
 
430
if [ ! -z "${unix_dir}" ]; then
431
        subdirs="${subdirs} libc/${unix_dir}"
432
        libc_unix_lib=${unix_dir}/lib.a
433
fi
434
 
435
if [ ! -z "${posix_dir}" ]; then
436
        subdirs="${subdirs} libc/${posix_dir}"
437
        libc_posix_lib=${posix_dir}/lib.a
438
fi
439
 
440
if [ ! -z "${signal_dir}" ]; then
441
        subdirs="${subdirs} libc/${signal_dir}"
442
        libc_signal_lib=${signal_dir}/lib.a
443
fi
444
 
445
if [ ! -z "${machine_dir}" ]; then
446
        subdirs="${subdirs} libc/machine libc/machine/${machine_dir}"
447
        libc_machine_lib=machine/lib.a
448
fi
449
 
450
if [ ! -z "${sys_dir}" ]; then
451
        subdirs="${subdirs} libc/sys libc/sys/${sys_dir}"
452
        libc_sys_lib=sys/lib.a
453
fi
454
 
455
if [ ! -z "${syscall_dir}" ]; then
456
        subdirs="${subdirs} libc/${syscall_dir}"
457
        libc_syscall_lib=${syscall_dir}/lib.a
458
fi
459
 
460
# If newlib_target is set, it is a target specific Makefile fragment.
461
# At the moment, no target needs one.
462
if [ ! -z "${newlib_target}" ]; then
463
        target_makefile_frag=config/${newlib_target}.mt
464
        echo "USING ${target_makefile_frag}..."
465
fi
466
 
467
# if sys_dir is set, then crt0 is built there.
468
if [ ! -z "${sys_dir}" ] ; then
469
        crt0=crt0.o
470
        crt0_dir=libc
471
fi
472
 
473
# end of per-target determination
474
 
475
# post-target:
476
 
477
# We want the Makefile to know machine_dir, sys_dir, signal_dir,
478
# and TARGET_CFLAGS, but we don't want to use a tiny Makefile fragment
479
# for each one.  So we use sed to edit the Makefile directly.  This
480
# isn't the way most of the tools work, but it saves Makefile fragments.
481
 
482
# Actually, this is pretty silly.  In general, each of these is used
483
# by only one makefile.  Keeping them here rather than with their
484
# associated makefiles is rather wasteful and counterintuitive.
485
 
486
sed -e "s:^machine_dir[         ]*=.*$:machine_dir = ${machine_dir}:" \
487
    -e "s:^sys_dir[     ]*=.*$:sys_dir = ${sys_dir}:" \
488
    -e "s:^signal_dir[  ]*=.*$:signal_dir = ${signal_dir}:" \
489
    -e "s:^TARGET_CFLAGS[       ]*=.*$:TARGET_CFLAGS = ${target_cflags}:" \
490
   -e "s:^LIBC_UNIX_LIB[        ]*=.*$:LIBC_UNIX_LIB = ${libc_unix_lib}:" \
491
   -e "s:^LIBC_POSIX_LIB[       ]*=.*$:LIBC_POSIX_LIB = ${libc_posix_lib}:" \
492
   -e "s:^LIBC_SIGNAL_LIB[      ]*=.*$:LIBC_SIGNAL_LIB = ${libc_signal_lib}:" \
493
   -e "s:^LIBC_MACHINE_LIB[     ]*=.*$:LIBC_MACHINE_LIB = ${libc_machine_lib}:" \
494
   -e "s:^LIBC_SYS_LIB[         ]*=.*$:LIBC_SYS_LIB = ${libc_sys_lib}:" \
495
   -e "s:^LIBC_SYSCALL_LIB[     ]*=.*$:LIBC_SYSCALL_LIB = ${libc_syscall_lib}:" \
496
   -e "s:^CRT0[         ]*=.*$:CRT0 = ${crt0}:" \
497
   -e "s:^CRT0_DIR[     ]*=.*$:CRT0_DIR = ${crt0_dir}:" \
498
        ${Makefile} > Makefile.tem
499
rm -f ${Makefile}
500
mv Makefile.tem ${Makefile}
501
 
502
# We need multilib support.
503
if [ "${srcdir}" = "." ] ; then
504
  if [ "${with_target_subdir}" != "." ] ; then
505
    . ${with_multisrctop}../../config-ml.in
506
  else
507
    . ${with_multisrctop}../config-ml.in
508
  fi
509
else
510
  . ${srcdir}/../config-ml.in
511
fi

powered by: WebSVN 2.1.0

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