Commit | Line | Data |
---|---|---|
ea838f99 SS |
1 | # Configuration fragment for GAS. |
2 | ||
9e4eebc2 SS |
3 | Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'` |
4 | ||
6144e9a9 SS |
5 | If "{target_arch}" =~ /powerpc/ |
6 | Set short_arch_name "ppc" | |
7 | Set target_cpu "powerpc" | |
8 | Else | |
9 | Set short_arch_name "{target_arch}" | |
10 | End If | |
11 | ||
f64fd87f | 12 | # The following works for many configurations, though not all. |
9e4eebc2 | 13 | |
a23e2b7c SS |
14 | Set obj_format `echo {target_canonical} | sed -e 's/.*-.*-//'` |
15 | ||
d21041b3 SS |
16 | Set bfd_gas no |
17 | ||
f64fd87f | 18 | Set TDEFINES "" |
a23e2b7c | 19 | |
6144e9a9 SS |
20 | Set EXTRA_OBJECTS "" |
21 | ||
a23e2b7c SS |
22 | If "{target_canonical}" =~ /m68k-apple-macos/ |
23 | Set obj_format "coff" | |
d21041b3 | 24 | Set TDEFINES '-d M68KCOFF' |
6144e9a9 SS |
25 | Set EXTRA_OBJECTS '"{o}"m68k-parse.c.o' |
26 | Else If "{target_canonical}" =~ /powerpc-apple-macos/ | |
27 | Set obj_format "coff" | |
d21041b3 SS |
28 | Set bfd_gas yes |
29 | Else If "{target_canonical}" =~ /i386-unknown-go32/ | |
a23e2b7c | 30 | Set obj_format "coff" |
d21041b3 SS |
31 | Set TDEFINES '-d I386COFF' |
32 | Else If "{target_canonical}" =~ /m68k-unknown-coff/ | |
33 | Set TDEFINES '-d M68KCOFF' | |
a23e2b7c | 34 | Else If "{target_canonical}" =~ /mips-idt-ecoff/ |
d21041b3 | 35 | Set bfd_gas yes |
a23e2b7c | 36 | Set TDEFINES '-d TARGET_BYTES_BIG_ENDIAN' |
d21041b3 SS |
37 | Else If "{target_canonical}" =~ /sh-hitachi-hms/ |
38 | Set obj_format "coff" | |
39 | forward-include "{srcroot}"opcodes:sh-opc.h 'opcodes/sh-opc.h' | |
a23e2b7c | 40 | End If |
9e4eebc2 | 41 | |
6144e9a9 SS |
42 | forward-include "{srcdir}"config:tc-{short_arch_name}.c targ-cpu.c |
43 | forward-include "{srcdir}"config:tc-{short_arch_name}.h targ-cpu.h | |
9e4eebc2 | 44 | |
a23e2b7c SS |
45 | forward-include "{srcdir}"config:obj-{obj_format}.c obj-format.c |
46 | forward-include "{srcdir}"config:obj-{obj_format}.h obj-format.h | |
9e4eebc2 SS |
47 | |
48 | # Default emulation. | |
49 | ||
50 | forward-include "{srcdir}"config:te-generic.h targ-env.h | |
51 | ||
a23e2b7c SS |
52 | # Special cases for float handling. |
53 | ||
9e4eebc2 SS |
54 | If "{target_arch}" =~ /ns32k/ |
55 | forward-include "{srcdir}"config:atof-ns32k.c atof-targ.c | |
56 | Else If "{target_arch}" =~ /tahoe/ | |
57 | forward-include "{srcdir}"config:atof-tahoe.c atof-targ.c | |
58 | Else If "{target_arch}" =~ /vax/ | |
59 | forward-include "{srcdir}"config:atof-vax.c atof-targ.c | |
60 | Else | |
61 | # Use IEEE by default. | |
62 | forward-include "{srcdir}"config:atof-ieee.c atof-targ.c | |
63 | End If | |
a23e2b7c | 64 | |
6144e9a9 SS |
65 | Echo '# From mpw-config.in' > "{o}"mk.tmp |
66 | Echo "TDEFINES = " {TDEFINES} >> "{o}"mk.tmp | |
67 | Echo "EXTRA_OBJECTS = " {EXTRA_OBJECTS} >> "{o}"mk.tmp | |
68 | # (We use the -n option here so as not to get extra spaces inserted) | |
69 | Echo -n 'TARG_CPU_DEP = {TARG_CPU_DEP_' >> "{o}"mk.tmp | |
70 | Echo -n {short_arch_name} >> "{o}"mk.tmp | |
71 | Echo -n '}' >> "{o}"mk.tmp | |
72 | Echo '# End from mpw-config.in' >> "{o}"mk.tmp | |
73 | ||
74 | Echo '/* conf. Generated by mpw-configure. */' > "{o}"conf.new | |
75 | Echo -n '#define TARGET_CPU "' >> "{o}"conf.new | |
76 | Echo -n "{target_cpu}" >> "{o}"conf.new | |
77 | Echo '"' >> "{o}"conf.new | |
78 | Echo -n '#define TARGET_ALIAS "' >> "{o}"conf.new | |
79 | Echo -n "{target_alias}" >> "{o}"conf.new | |
80 | Echo '"' >> "{o}"conf.new | |
81 | Echo -n '#define TARGET_CANONICAL "' >> "{o}"conf.new | |
82 | Echo -n "{target_canonical}" >> "{o}"conf.new | |
83 | Echo '"' >> "{o}"conf.new | |
84 | Echo '#include "mpw.h"' >> "{o}"conf.new | |
d21041b3 | 85 | If "{bfd_gas}" =~ /yes/ |
6144e9a9 | 86 | Echo "#define BFD_ASSEMBLER" >> "{o}"conf.new |
d21041b3 | 87 | Else |
6144e9a9 | 88 | Echo "#define MANY_SEGMENTS" >> "{o}"conf.new |
d21041b3 | 89 | End If |
6144e9a9 SS |
90 | Echo '#define CR_EOL' >> "{o}"conf.new |
91 | Echo '#define OBJ_COFF_OMIT_TIMESTAMP' >> "{o}"conf.new | |
92 | Echo '#define LOSING_COMPILER' >> "{o}"conf.new | |
d21041b3 | 93 | |
6144e9a9 | 94 | MoveIfChange "{o}"conf.new "{o}"conf |
a23e2b7c | 95 | |
6144e9a9 | 96 | sed -e "s/@srcdir@/{srcdir}/" "{srcdir}"gdbinit.in > "{o}"_gdbinit |