| 1 | # Configuration fragment for BFD. |
| 2 | |
| 3 | forward-include "{srcdir}"hosts:mpw.h sysdep.h |
| 4 | |
| 5 | # We can only handle 32-bit targets right now. |
| 6 | |
| 7 | sed -e 's/@WORDSIZE@/32/' -e "s/@VERSION@/`Catenate {srcdir}VERSION`/" {srcdir}bfd-in2.h >bfd.h-new |
| 8 | MoveIfChange bfd.h-new bfd.h |
| 9 | |
| 10 | # Pre-expand some macros in coffswap.h, so MPW C doesn't choke. |
| 11 | |
| 12 | 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 |
| 13 | MoveIfChange coffswap.h-new coffswap.h |
| 14 | |
| 15 | # This is almost always correct. |
| 16 | |
| 17 | Set selarchs bfd_{target_cpu}_arch |
| 18 | Set defvec "" |
| 19 | Set selvecs "" |
| 20 | |
| 21 | If "{target_canonical}" =~ /m68k-apple-macos/ |
| 22 | Set BFD_BACKENDS '"{o}"coff-m68k.c.o "{o}"cofflink.c.o' |
| 23 | Set defvec m68kcoff_vec |
| 24 | Set selvecs '&m68kcoff_vec' |
| 25 | Else If "{target_canonical}" =~ /powerpc-apple-macos/ |
| 26 | Set BFD_BACKENDS '"{o}"coff-rs6000.c.o' |
| 27 | Set defvec rs6000coff_vec |
| 28 | Set selvecs '&rs6000coff_vec' |
| 29 | Set selarchs bfd_powerpc_arch |
| 30 | Else If "{target_canonical}" =~ /i386-unknown-go32/ |
| 31 | Set BFD_BACKENDS '"{o}"coff-i386.c.o' |
| 32 | Set defvec i386coff_vec |
| 33 | Set selvecs '&i386coff_vec' |
| 34 | Else If "{target_canonical}" =~ /mips-idt-ecoff/ |
| 35 | Set BFD_BACKENDS '"{o}"coff-mips.c.o "{o}"ecoff.c.o "{o}"ecofflink.c.o' |
| 36 | Set defvec ecoff_big_vec |
| 37 | Set selvecs '&ecoff_big_vec,&ecoff_little_vec' |
| 38 | Else If "{target_canonical}" =~ /sh-hitachi-hms/ |
| 39 | Set BFD_BACKENDS '"{o}"coff-sh.c.o "{o}"cofflink.c.o' |
| 40 | Set defvec shcoff_vec |
| 41 | Set selvecs '&shcoff_vec,&shlcoff_vec' |
| 42 | End If |
| 43 | |
| 44 | Set ta `echo {selarchs} | sed -e 's/bfd_/{o}cpu-/g' -e 's/_arch/.c.o/g'` |
| 45 | |
| 46 | Set tdefaults "-d DEFAULT_VECTOR={defvec} -d SELECT_VECS={selvecs} -d SELECT_ARCHITECTURES={selarchs}" |
| 47 | |
| 48 | Echo '# From mpw-config.in' > "{o}"mk.tmp |
| 49 | |
| 50 | Echo 'WORDSIZE = 32' >> "{o}"mk.tmp |
| 51 | |
| 52 | Echo 'BFD_MACHINES = ' {ta} >>"{o}"mk.tmp |
| 53 | |
| 54 | Echo 'BFD_BACKENDS = ' {BFD_BACKENDS} >> "{o}"mk.tmp |
| 55 | |
| 56 | Echo 'TDEFAULTS = ' {tdefaults} >> "{o}"mk.tmp |
| 57 | |
| 58 | Echo '# End from mpw-config.in' >> "{o}"mk.tmp |