[PATCH] Unbreak buildworld post-r215254

Garrett Cooper gcooper at FreeBSD.org
Sat Nov 13 20:27:34 UTC 2010


	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)
@@ -124,7 +124,8 @@
 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
@@ -133,7 +134,8 @@
 .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


More information about the freebsd-current mailing list