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