aboutsummaryrefslogtreecommitdiff
path: root/bfd/mpw-config.in
blob: 89deaa7b000e180a984c9c895e76be705b98a70a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Configuration fragment for BFD.

forward-include "{srcdir}"hosts:mpw.h sysdep.h

# We can only handle 32-bit targets right now.

sed -e 's/@WORDSIZE@/32/' -e "s/@VERSION@/`Catenate {srcdir}VERSION`/" {srcdir}bfd-in2.h >bfd.h-new
MoveIfChange bfd.h-new bfd.h

# Pre-expand some macros in coffswap.h, so MPW C doesn't choke.

sed -e 's/^  PUT_AOUTHDR_TSIZE (/  bfd_h_put_32 (/' -e 's/^  PUT_AOUTHDR_DSIZE (/  bfd_h_put_32 (/' -e 's/^  PUT_AOUTHDR_BSIZE (/  bfd_h_put_32 (/' -e 's/^  PUT_AOUTHDR_ENTRY (/  bfd_h_put_32 (/' -e 's/^  PUT_AOUTHDR_TEXT_START (/  bfd_h_put_32 (/' -e 's/^  PUT_AOUTHDR_DATA_START (/  bfd_h_put_32 (/' {srcdir}coffswap.h >coffswap.h-new
MoveIfChange coffswap.h-new coffswap.h

# This is almost always correct.

Set selarchs bfd_{target_cpu}_arch
Set defvec ""
Set selvecs ""

If "{target_canonical}" =~ /m68k-apple-macos/
	Set BFD_BACKENDS '"{o}"coff-m68k.c.o "{o}"cofflink.c.o'
	Set defvec m68kcoff_vec
	Set selvecs '&m68kcoff_vec'
Else If "{target_canonical}" =~ /powerpc-apple-macos/
	Set BFD_BACKENDS '"{o}"coff-rs6000.c.o'
	Set defvec rs6000coff_vec
	Set selvecs '&rs6000coff_vec'
	Set selarchs bfd_powerpc_arch
Else If "{target_canonical}" =~ /i386-unknown-go32/
	Set BFD_BACKENDS '"{o}"coff-i386.c.o'
	Set defvec i386coff_vec
	Set selvecs '&i386coff_vec'
Else If "{target_canonical}" =~ /mips-idt-ecoff/
	Set BFD_BACKENDS '"{o}"coff-mips.c.o "{o}"ecoff.c.o "{o}"ecofflink.c.o'
	Set defvec ecoff_big_vec
	Set selvecs '&ecoff_big_vec,&ecoff_little_vec'
Else If "{target_canonical}" =~ /sh-hitachi-hms/
	Set BFD_BACKENDS '"{o}"coff-sh.c.o "{o}"cofflink.c.o'
	Set defvec shcoff_vec
	Set selvecs '&shcoff_vec,&shlcoff_vec'
End If

Set ta `echo {selarchs} | sed -e 's/bfd_/{o}cpu-/g' -e 's/_arch/.c.o/g'`

Set tdefaults "-d DEFAULT_VECTOR={defvec} -d SELECT_VECS={selvecs} -d SELECT_ARCHITECTURES={selarchs}"

Echo '# From mpw-config.in' > "{o}"mk.tmp

Echo 'WORDSIZE = 32'	>> "{o}"mk.tmp

Echo 'BFD_MACHINES = ' {ta} >>"{o}"mk.tmp

Echo 'BFD_BACKENDS = ' {BFD_BACKENDS} >> "{o}"mk.tmp

Echo 'TDEFAULTS = ' {tdefaults} >> "{o}"mk.tmp

Echo '# End from mpw-config.in' >> "{o}"mk.tmp