1 # Configuration fragment for BFD.
3 # This is almost always correct.
5 Set selarchs "&bfd_{target_cpu}_arch"
9 If "{target_canonical}" =~ /m68k-apple-macos/
10 Set BFD_BACKENDS '"{o}"coff-m68k.c.o "{o}"cofflink.c.o'
11 Set defvec m68kcoff_vec
12 Set selvecs '&m68kcoff_vec'
13 Else If "{target_canonical}" =~ /powerpc-apple-macos/
14 Set BFD_BACKENDS '"{o}"coff-pmac.c.o "{o}"cofflink.c.o'
15 Set defvec pmac_xcoff_vec
16 Set selvecs '&pmac_xcoff_vec'
17 Set selarchs "&bfd_powerpc_arch"
18 Else If "{target_canonical}" =~ /i386-unknown-go32/
19 Set BFD_BACKENDS '"{o}"coff-i386.c.o'
20 Set defvec i386coff_vec
21 Set selvecs '&i386coff_vec'
22 Else If "{target_canonical}" =~ /mips-idt-ecoff/
23 Set BFD_BACKENDS '"{o}"coff-mips.c.o "{o}"ecoff.c.o "{o}"ecofflink.c.o'
24 Set defvec ecoff_big_vec
25 Set selvecs '&ecoff_big_vec,&ecoff_little_vec'
26 Else If "{target_canonical}" =~ /sh-hitachi-hms/
27 Set BFD_BACKENDS '"{o}"coff-sh.c.o "{o}"cofflink.c.o'
29 Set selvecs '&shcoff_vec,&shlcoff_vec'
32 Set ta `echo {selarchs} | sed -e 's/&bfd_/{o}cpu-/g' -e 's/_arch/.c.o/g'`
34 Set tdefaults "-d DEFAULT_VECTOR={defvec} -d SELECT_VECS={selvecs} -d SELECT_ARCHITECTURES={selarchs}"
36 Echo '# From mpw-config.in' > "{o}"mk.tmp
37 Echo 'WORDSIZE = 32' >> "{o}"mk.tmp
38 Echo 'BFD_MACHINES = ' {ta} >> "{o}"mk.tmp
39 Echo 'BFD_BACKENDS = ' {BFD_BACKENDS} >> "{o}"mk.tmp
40 Echo 'TDEFAULTS = ' {tdefaults} >> "{o}"mk.tmp
41 Echo 'HDEPFILES = ' >> "{o}"mk.tmp
42 Echo 'TDEPFILES = ' >> "{o}"mk.tmp
43 Echo '# End from mpw-config.in' >> "{o}"mk.tmp
45 Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new
46 Echo '#include "mpw.h"' >> "{o}"config.new
48 MoveIfChange "{o}"config.new "{o}"config.h
50 # We can only handle 32-bit targets right now.
52 sed -e 's/@WORDSIZE@/32/' \Option-d
53 -e "s/@VERSION@/`Catenate {srcdir}VERSION`/" \Option-d
54 -e 's/@BFD_HOST_64BIT_LONG@/0/' \Option-d
55 "{srcdir}"bfd-in2.h >"{o}"bfd.h-new
57 MoveIfChange "{o}"bfd.h-new "{o}"bfd.h
59 # Pre-expand some macros in coffswap.h, so MPW C doesn't choke.
61 sed -e 's/^ PUT_AOUTHDR_TSIZE (/ bfd_h_put_32 (/' \Option-d
62 -e 's/^ PUT_AOUTHDR_DSIZE (/ bfd_h_put_32 (/' \Option-d
63 -e 's/^ PUT_AOUTHDR_BSIZE (/ bfd_h_put_32 (/' \Option-d
64 -e 's/^ PUT_AOUTHDR_ENTRY (/ bfd_h_put_32 (/' \Option-d
65 -e 's/^ PUT_AOUTHDR_TEXT_START (/ bfd_h_put_32 (/' \Option-d
66 -e 's/^ PUT_AOUTHDR_DATA_START (/ bfd_h_put_32 (/' \Option-d
67 "{srcdir}"coffswap.h >"{o}"coffswap.h-new
69 MoveIfChange "{o}"coffswap.h-new "{o}"coffswap.h