aboutsummaryrefslogtreecommitdiff
path: root/gas/mpw-config.in
diff options
context:
space:
mode:
Diffstat (limited to 'gas/mpw-config.in')
-rw-r--r--gas/mpw-config.in53
1 files changed, 41 insertions, 12 deletions
diff --git a/gas/mpw-config.in b/gas/mpw-config.in
index 320daac..ae7e298 100644
--- a/gas/mpw-config.in
+++ b/gas/mpw-config.in
@@ -2,6 +2,13 @@
Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'`
+If "{target_arch}" =~ /powerpc/
+ Set short_arch_name "ppc"
+ Set target_cpu "powerpc"
+Else
+ Set short_arch_name "{target_arch}"
+End If
+
# The following works for many configurations, though not all.
Set obj_format `echo {target_canonical} | sed -e 's/.*-.*-//'`
@@ -10,11 +17,14 @@ Set bfd_gas no
Set TDEFINES ""
+Set EXTRA_OBJECTS ""
+
If "{target_canonical}" =~ /m68k-apple-macos/
Set obj_format "coff"
Set TDEFINES '-d M68KCOFF'
-Else If "{target_canonical}" =~ /ppc-apple-macos/
- Set obj_format "xcoff"
+ Set EXTRA_OBJECTS '"{o}"m68k-parse.c.o'
+Else If "{target_canonical}" =~ /powerpc-apple-macos/
+ Set obj_format "coff"
Set bfd_gas yes
Else If "{target_canonical}" =~ /i386-unknown-go32/
Set obj_format "coff"
@@ -29,8 +39,8 @@ Else If "{target_canonical}" =~ /sh-hitachi-hms/
forward-include "{srcroot}"opcodes:sh-opc.h 'opcodes/sh-opc.h'
End If
-forward-include "{srcdir}"config:tc-{target_arch}.c targ-cpu.c
-forward-include "{srcdir}"config:tc-{target_arch}.h targ-cpu.h
+forward-include "{srcdir}"config:tc-{short_arch_name}.c targ-cpu.c
+forward-include "{srcdir}"config:tc-{short_arch_name}.h targ-cpu.h
forward-include "{srcdir}"config:obj-{obj_format}.c obj-format.c
forward-include "{srcdir}"config:obj-{obj_format}.h obj-format.h
@@ -52,16 +62,35 @@ Else
forward-include "{srcdir}"config:atof-ieee.c atof-targ.c
End If
-Echo '# From mpw-config.in' > "{o}"mk.tmp
-
-Echo 'VERSION = ' `Search 'VERSION=' "{srcdir}"Makefile.in | sed -e 's/.*VERSION=\(.*\)/\1/'` >> "{o}"mk.tmp
-
+Echo '# From mpw-config.in' > "{o}"mk.tmp
+Echo "TDEFINES = " {TDEFINES} >> "{o}"mk.tmp
+Echo "EXTRA_OBJECTS = " {EXTRA_OBJECTS} >> "{o}"mk.tmp
+# (We use the -n option here so as not to get extra spaces inserted)
+Echo -n 'TARG_CPU_DEP = {TARG_CPU_DEP_' >> "{o}"mk.tmp
+Echo -n {short_arch_name} >> "{o}"mk.tmp
+Echo -n '}' >> "{o}"mk.tmp
+Echo '# End from mpw-config.in' >> "{o}"mk.tmp
+
+Echo '/* conf. Generated by mpw-configure. */' > "{o}"conf.new
+Echo -n '#define TARGET_CPU "' >> "{o}"conf.new
+Echo -n "{target_cpu}" >> "{o}"conf.new
+Echo '"' >> "{o}"conf.new
+Echo -n '#define TARGET_ALIAS "' >> "{o}"conf.new
+Echo -n "{target_alias}" >> "{o}"conf.new
+Echo '"' >> "{o}"conf.new
+Echo -n '#define TARGET_CANONICAL "' >> "{o}"conf.new
+Echo -n "{target_canonical}" >> "{o}"conf.new
+Echo '"' >> "{o}"conf.new
+Echo '#include "mpw.h"' >> "{o}"conf.new
If "{bfd_gas}" =~ /yes/
- Echo "HACK_O_RAMA = BFD_ASSEMBLER" >> "{o}"mk.tmp
+ Echo "#define BFD_ASSEMBLER" >> "{o}"conf.new
Else
- Echo "HACK_O_RAMA = MANY_SEGMENTS" >> "{o}"mk.tmp
+ Echo "#define MANY_SEGMENTS" >> "{o}"conf.new
End If
+Echo '#define CR_EOL' >> "{o}"conf.new
+Echo '#define OBJ_COFF_OMIT_TIMESTAMP' >> "{o}"conf.new
+Echo '#define LOSING_COMPILER' >> "{o}"conf.new
-Echo "TDEFINES = " {TDEFINES} >> "{o}"mk.tmp
+MoveIfChange "{o}"conf.new "{o}"conf
-Echo '# End from mpw-config.in' >> "{o}"mk.tmp
+sed -e "s/@srcdir@/{srcdir}/" "{srcdir}"gdbinit.in > "{o}"_gdbinit