[PATCH] Unbreak buildworld post-r215254

From: Garrett Cooper <gcooper_at_FreeBSD.org>
Date: Sat, 13 Nov 2010 12:27:32 -0800
	Looks like buildworld is broken when TARGET/TARGET_ARCH isn't specified:

$ make buildworld
"/usr/src/Makefile.inc1", line 127: Malformed conditional
(${TARGET_ARCH} == "mips" && ${TARGET} == "mips")
"/usr/src/Makefile.inc1", line 128: warning: "TARGET_ARCH of mips is
deprecated in favor of mipsel or mipseb"
"/usr/src/Makefile.inc1", line 134: if-less endif
"/usr/src/Makefile.inc1", line 152: Unknown target mipsel:amd64.
*** Error code 1

	This change fixed it:

$ svn diff Makefile.inc1
Index: Makefile.inc1
===================================================================
--- Makefile.inc1	(revision 215254)
+++ Makefile.inc1	(working copy)
_at__at_ -124,7 +124,8 _at__at_
 TARGET=		${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm}
 .endif
 # Legacy names, for a transition period mips:mips -> mipsel:mips
-.if ${TARGET_ARCH} == "mips" && ${TARGET} == "mips"
+.if defined(TARGET_ARCH) && defined(TARGET) && ${TARGET_ARCH} == "mips" && \
+    ${TARGET} == "mips"
 .warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb"
 .if defined(TARGET_BIG_ENDIAN)
 TARGET_ARCH=mipseb
_at__at_ -133,7 +134,8 _at__at_
 .endif
 .endif
 # arm with TARGET_BIG_ENDIAN -> armeb
-.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
+.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && \
+    defined(TARGET_BIG_ENDIAN)
 .warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated.  use armeb"
 TARGET_ARCH=armeb
 .endif

Thanks!
-Garrett
Received on Sat Nov 13 2010 - 19:27:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:09 UTC