Subject: Makefile diffs to build egcs on mips(el,eb)
To: None <tech-toolchain@netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-toolchain
Date: 10/26/1998 18:03:57
The following patch to src/gnu/usr.bin/egcs/common/Makfile lets me
build a libcc1.so.1.1 on mipsel.  

It still needs 
   a) Castor Fu's patch,
   b)  some more fixup to set -G0 when  producing PIC code (the default);
       that can be  lifted from the gcc config

otherwise it seems to compile its way through a kernel and egcs itself
without core-dumping.  i have no idea how correct the resulting
objects are, though.

[matt  -- does the expr.c patch help your vax quandary?]



*** Makefile.DIST	Thu Oct 15 04:06:45 1998
--- Makefile	Mon Oct 26 17:54:41 1998
***************
*** 8,24 ****
  NOLINKLIB=
  YHEADER=1
  
  CPPFLAGS+=	-DTARGET_NAME=\"${MACHINE_GNU_ARCH}-netbsd\"
  CPICFLAGS=	-fPIC -DPIC
  HOST_CPPFLAGS=	${CPPFLAGS}
  
! MD=		${DIST}/config/${MACHINE_GNU_ARCH}/${MACHINE_GNU_ARCH}.md
  
  BCDEF=		${DIST}/bytecode.def
  
  .PATH:		${DIST}
  
! SRCS=		${MACHINE_GNU_ARCH}.c toplev.c version.c tree.c print-tree.c \
  		stor-layout.c fold-const.c function.c stmt.c except.c expr.c \
  		calls.c expmed.c explow.c optabs.c varasm.c rtl.c print-rtl.c \
  		rtlanal.c emit-rtl.c genrtl.c real.c regmove.c dbxout.c \
--- 8,31 ----
  NOLINKLIB=
  YHEADER=1
  
+ # GNU (gcc,gas) uses "mips" as arch-dependent filename for mipsel and mipseb
+ .if (${MACHINE_ARCH} == "mips")
+ GCC_ARCH?=	${MACHINE_ARCH}
+ .else
+ GCC_ARCH?=	${MACHINE_GNU_ARCH}
+ .endif
+ 
  CPPFLAGS+=	-DTARGET_NAME=\"${MACHINE_GNU_ARCH}-netbsd\"
  CPICFLAGS=	-fPIC -DPIC
  HOST_CPPFLAGS=	${CPPFLAGS}
  
! MD=		${DIST}/config/${GCC_ARCH}/${GCC_ARCH}.md
  
  BCDEF=		${DIST}/bytecode.def
  
  .PATH:		${DIST}
  
! SRCS=		${GCC_ARCH}.c toplev.c version.c tree.c print-tree.c \
  		stor-layout.c fold-const.c function.c stmt.c except.c expr.c \
  		calls.c expmed.c explow.c optabs.c varasm.c rtl.c print-rtl.c \
  		rtlanal.c emit-rtl.c genrtl.c real.c regmove.c dbxout.c \
***************
*** 90,93 ****
  ${OBJS} ${SOBJS} genattrtab.lo genextract.lo: \
  		insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h
  
! .PATH:		${DIST}/config/${MACHINE_GNU_ARCH}
--- 97,100 ----
  ${OBJS} ${SOBJS} genattrtab.lo genextract.lo: \
  		insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h
  
! .PATH:		${DIST}/config/${GCC_ARCH}