]>
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 | ||
90f543f6 SS |
22 | # Default emulation. |
23 | ||
24 | Set em generic | |
25 | ||
a23e2b7c SS |
26 | If "{target_canonical}" =~ /m68k-apple-macos/ |
27 | Set obj_format "coff" | |
d21041b3 | 28 | Set TDEFINES '-d M68KCOFF' |
6144e9a9 | 29 | Set EXTRA_OBJECTS '"{o}"m68k-parse.c.o' |
90f543f6 | 30 | |
6144e9a9 SS |
31 | Else If "{target_canonical}" =~ /powerpc-apple-macos/ |
32 | Set obj_format "coff" | |
d21041b3 | 33 | Set bfd_gas yes |
90f543f6 SS |
34 | Set em macos |
35 | ||
d21041b3 | 36 | Else If "{target_canonical}" =~ /i386-unknown-go32/ |
a23e2b7c | 37 | Set obj_format "coff" |
d21041b3 | 38 | Set TDEFINES '-d I386COFF' |
90f543f6 | 39 | |
d21041b3 SS |
40 | Else If "{target_canonical}" =~ /m68k-unknown-coff/ |
41 | Set TDEFINES '-d M68KCOFF' | |
90f543f6 | 42 | |
a23e2b7c | 43 | Else If "{target_canonical}" =~ /mips-idt-ecoff/ |
d21041b3 | 44 | Set bfd_gas yes |
a23e2b7c | 45 | Set TDEFINES '-d TARGET_BYTES_BIG_ENDIAN' |
90f543f6 SS |
46 | |
47 | # start-sanitize-gm | |
48 | Else If "{target_canonical}" =~ /mips-gm-magic/ | |
49 | Set obj_format "ecoff" | |
50 | Set bfd_gas yes | |
51 | Set TDEFINES '-d TARGET_BYTES_BIG_ENDIAN' | |
52 | # end-sanitize-gm | |
53 | ||
d21041b3 SS |
54 | Else If "{target_canonical}" =~ /sh-hitachi-hms/ |
55 | Set obj_format "coff" | |
56 | forward-include "{srcroot}"opcodes:sh-opc.h 'opcodes/sh-opc.h' | |
a23e2b7c | 57 | End If |
9e4eebc2 | 58 | |
6144e9a9 SS |
59 | forward-include "{srcdir}"config:tc-{short_arch_name}.c targ-cpu.c |
60 | forward-include "{srcdir}"config:tc-{short_arch_name}.h targ-cpu.h | |
9e4eebc2 | 61 | |
a23e2b7c SS |
62 | forward-include "{srcdir}"config:obj-{obj_format}.c obj-format.c |
63 | forward-include "{srcdir}"config:obj-{obj_format}.h obj-format.h | |
9e4eebc2 | 64 | |
90f543f6 | 65 | forward-include "{srcdir}"config:te-{em}.h targ-env.h |
9e4eebc2 | 66 | |
a23e2b7c SS |
67 | # Special cases for float handling. |
68 | ||
9e4eebc2 SS |
69 | If "{target_arch}" =~ /ns32k/ |
70 | forward-include "{srcdir}"config:atof-ns32k.c atof-targ.c | |
71 | Else If "{target_arch}" =~ /tahoe/ | |
72 | forward-include "{srcdir}"config:atof-tahoe.c atof-targ.c | |
73 | Else If "{target_arch}" =~ /vax/ | |
74 | forward-include "{srcdir}"config:atof-vax.c atof-targ.c | |
75 | Else | |
76 | # Use IEEE by default. | |
77 | forward-include "{srcdir}"config:atof-ieee.c atof-targ.c | |
78 | End If | |
a23e2b7c | 79 | |
6144e9a9 SS |
80 | Echo '# From mpw-config.in' > "{o}"mk.tmp |
81 | Echo "TDEFINES = " {TDEFINES} >> "{o}"mk.tmp | |
82 | Echo "EXTRA_OBJECTS = " {EXTRA_OBJECTS} >> "{o}"mk.tmp | |
83 | # (We use the -n option here so as not to get extra spaces inserted) | |
84 | Echo -n 'TARG_CPU_DEP = {TARG_CPU_DEP_' >> "{o}"mk.tmp | |
85 | Echo -n {short_arch_name} >> "{o}"mk.tmp | |
86 | Echo -n '}' >> "{o}"mk.tmp | |
87 | Echo '# End from mpw-config.in' >> "{o}"mk.tmp | |
88 | ||
89 | Echo '/* conf. Generated by mpw-configure. */' > "{o}"conf.new | |
90 | Echo -n '#define TARGET_CPU "' >> "{o}"conf.new | |
91 | Echo -n "{target_cpu}" >> "{o}"conf.new | |
92 | Echo '"' >> "{o}"conf.new | |
93 | Echo -n '#define TARGET_ALIAS "' >> "{o}"conf.new | |
94 | Echo -n "{target_alias}" >> "{o}"conf.new | |
95 | Echo '"' >> "{o}"conf.new | |
96 | Echo -n '#define TARGET_CANONICAL "' >> "{o}"conf.new | |
97 | Echo -n "{target_canonical}" >> "{o}"conf.new | |
98 | Echo '"' >> "{o}"conf.new | |
99 | Echo '#include "mpw.h"' >> "{o}"conf.new | |
d21041b3 | 100 | If "{bfd_gas}" =~ /yes/ |
6144e9a9 | 101 | Echo "#define BFD_ASSEMBLER" >> "{o}"conf.new |
d21041b3 | 102 | Else |
6144e9a9 | 103 | Echo "#define MANY_SEGMENTS" >> "{o}"conf.new |
d21041b3 | 104 | End If |
6144e9a9 SS |
105 | Echo '#define CR_EOL' >> "{o}"conf.new |
106 | Echo '#define OBJ_COFF_OMIT_TIMESTAMP' >> "{o}"conf.new | |
107 | Echo '#define LOSING_COMPILER' >> "{o}"conf.new | |
d21041b3 | 108 | |
6144e9a9 | 109 | MoveIfChange "{o}"conf.new "{o}"conf |
a23e2b7c | 110 | |
6144e9a9 | 111 | sed -e "s/@srcdir@/{srcdir}/" "{srcdir}"gdbinit.in > "{o}"_gdbinit |