Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # Configuration fragment for BFD. |
2 | ||
3 | # This is almost always correct. | |
4 | ||
5 | Set selarchs "&bfd_{target_cpu}_arch" | |
6 | Set defvec "" | |
7 | Set selvecs "" | |
8 | Set havevecs "" | |
9 | ||
10 | If "{target_canonical}" =~ /m68k-apple-macos/ | |
11 | Set BFD_BACKENDS '"{o}"coff-m68k.c.o "{o}"cofflink.c.o' | |
12 | Set defvec m68kcoff_vec | |
13 | Set selvecs '&m68kcoff_vec' | |
14 | Set havevecs '-d HAVE_m68kcoff_vec' | |
15 | ||
16 | Else If "{target_canonical}" =~ /powerpc-apple-macos/ | |
17 | Set BFD_BACKENDS '"{o}"coff-pmac.c.o "{o}"xcofflink.c.o' | |
18 | Set defvec pmac_xcoff_vec | |
19 | Set selvecs '&pmac_xcoff_vec' | |
20 | Set havevecs '-d HAVE_pmac_xcoff_vec' | |
21 | Set selarchs "&bfd_powerpc_arch" | |
22 | ||
23 | Else If "{target_canonical}" =~ /i386-\Option-x-go32/ | |
24 | Set BFD_BACKENDS '"{o}"coff-i386.c.o' | |
25 | Set defvec i386coff_vec | |
26 | Set selvecs '&i386coff_vec' | |
27 | Set havevecs '-d HAVE_i386coff_vec' | |
28 | ||
29 | Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/ | |
30 | Set BFD_BACKENDS '"{o}"coff-mips.c.o "{o}"ecoff.c.o "{o}"ecofflink.c.o "{o}"elf32.c.o "{o}"elf32-mips.c.o "{o}"elflink.c.o' | |
31 | Set defvec ecoff_big_vec | |
32 | Set selvecs '&ecoff_big_vec,&ecoff_little_vec,&bfd_elf32_bigmips_vec' | |
33 | Set havevecs '-d HAVE_ecoff_big_vec -d HAVE_ecoff_little_vec -d HAVE_bfd_elf32_bigmips_vec' | |
34 | ||
35 | Else If "{target_canonical}" =~ /sh-\Option-x-hms/ | |
36 | Set BFD_BACKENDS '"{o}"coff-sh.c.o "{o}"cofflink.c.o' | |
37 | Set defvec shcoff_vec | |
38 | Set selvecs '&shcoff_vec,&shlcoff_vec' | |
39 | Set havevecs '-d HAVE_shcoff_vec -d HAVE_shlcoff_vec' | |
40 | End If | |
41 | ||
42 | Set ta `echo {selarchs} | sed -e 's/&bfd_/{o}cpu-/g' -e 's/_arch/.c.o/g'` | |
43 | ||
44 | Set tdefaults "-d DEFAULT_VECTOR={defvec} -d SELECT_VECS={selvecs} -d SELECT_ARCHITECTURES={selarchs} {havevecs}" | |
45 | ||
46 | Echo '# From mpw-config.in' > "{o}"mk.tmp | |
47 | Echo 'WORDSIZE = 32' >> "{o}"mk.tmp | |
48 | Echo 'BFD_MACHINES = ' {ta} >> "{o}"mk.tmp | |
49 | Echo 'BFD_BACKENDS = ' {BFD_BACKENDS} >> "{o}"mk.tmp | |
50 | Echo 'TDEFAULTS = ' {tdefaults} >> "{o}"mk.tmp | |
51 | Echo 'HDEPFILES = ' >> "{o}"mk.tmp | |
52 | Echo 'TDEPFILES = ' >> "{o}"mk.tmp | |
53 | Echo '# End from mpw-config.in' >> "{o}"mk.tmp | |
54 | ||
55 | Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new | |
56 | Echo '#include "mpw.h"' >> "{o}"config.new | |
57 | ||
58 | MoveIfChange "{o}"config.new "{o}"config.h | |
59 | ||
60 | # We can only handle 32-bit targets right now. | |
61 | ||
62 | sed -e 's/@WORDSIZE@/32/' \Option-d | |
63 | -e 's/@wordsize@/32/' \Option-d | |
64 | -e "s/@VERSION@/`Catenate {srcdir}VERSION`/" \Option-d | |
65 | -e 's/@BFD_HOST_64_BIT_DEFINED@/0/' \Option-d | |
66 | -e 's/@BFD_HOST_64_BIT@//' \Option-d | |
67 | -e 's/@BFD_HOST_U_64_BIT@//' \Option-d | |
68 | -e 's/@BFD_HOST_64BIT_LONG@/0/' \Option-d | |
69 | "{srcdir}"bfd-in2.h >"{o}"bfd.h-new | |
70 | ||
71 | MoveIfChange "{o}"bfd.h-new "{o}"bfd.h | |
72 | ||
73 | sed -e 's/NN/32/g' "{srcdir}"elfxx-target.h >"{o}"elf32-target.h-new | |
74 | MoveIfChange "{o}"elf32-target.h-new "{o}"elf32-target.h | |
75 | ||
76 | # Pre-expand some macros in coffswap.h, so MPW C doesn't choke. | |
77 | ||
78 | sed -e 's/^ PUT_AOUTHDR_TSIZE (/ bfd_h_put_32 (/' \Option-d | |
79 | -e 's/^ PUT_AOUTHDR_DSIZE (/ bfd_h_put_32 (/' \Option-d | |
80 | -e 's/^ PUT_AOUTHDR_BSIZE (/ bfd_h_put_32 (/' \Option-d | |
81 | -e 's/^ PUT_AOUTHDR_ENTRY (/ bfd_h_put_32 (/' \Option-d | |
82 | -e 's/^ PUT_AOUTHDR_TEXT_START (/ bfd_h_put_32 (/' \Option-d | |
83 | -e 's/^ PUT_AOUTHDR_DATA_START (/ bfd_h_put_32 (/' \Option-d | |
84 | "{srcdir}"coffswap.h >"{o}"coffswap.h-new | |
85 | ||
86 | MoveIfChange "{o}"coffswap.h-new "{o}"coffswap.h |