Module Name:    src
Committed By:   maya
Date:           Wed Dec 11 00:06:58 UTC 2024

Modified Files:
        src/distrib/evbppc/md-kernel: Makefile
        src/share/mk: bsd.own.mk
        src/sys/arch/evbppc/compile: walnut-mkimg.sh

Log Message:
Avoid using host tools for building INSTALL_WALNUT kernel

>From Kouichi Hashikawa in PR toolchain/58810


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/evbppc/md-kernel/Makefile
cvs rdiff -u -r1.1408 -r1.1409 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbppc/compile/walnut-mkimg.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/evbppc/md-kernel/Makefile
diff -u src/distrib/evbppc/md-kernel/Makefile:1.6 src/distrib/evbppc/md-kernel/Makefile:1.7
--- src/distrib/evbppc/md-kernel/Makefile:1.6	Fri Jan 30 15:04:35 2015
+++ src/distrib/evbppc/md-kernel/Makefile	Wed Dec 11 00:06:58 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2015/01/30 15:04:35 nonaka Exp $
+#	$NetBSD: Makefile,v 1.7 2024/12/11 00:06:58 maya Exp $
 
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -16,6 +16,7 @@ MDSET_RELEASEDIR=	binary/kernel
 MDSET_SUFFIXES.-=	img create-img
 
 create-img= \
+	AWK=${TOOL_AWK}; FILE=${TOOL_FILE}; \
 	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
 		export OBJDUMP OBJCOPY STAT; ${MKIMG} ${.TARGET:R} ${.TARGET}
 

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1408 src/share/mk/bsd.own.mk:1.1409
--- src/share/mk/bsd.own.mk:1.1408	Wed Oct 23 00:50:47 2024
+++ src/share/mk/bsd.own.mk	Wed Dec 11 00:06:58 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1408 2024/10/23 00:50:47 kalvisd Exp $
+#	$NetBSD: bsd.own.mk,v 1.1409 2024/12/11 00:06:58 maya Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -489,6 +489,7 @@ TOOL_DTC=		${TOOLDIR}/bin/${_TOOL_PREFIX
 TOOL_EQN=		${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
 TOOL_FDISK=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
 TOOL_FGEN=		${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
+TOOL_FILE=		${TOOLDIR}/bin/${_TOOL_PREFIX}file
 TOOL_GENASSYM=		${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
 TOOL_GENCAT=		${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
 TOOL_GMAKE=		${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
@@ -617,6 +618,7 @@ TOOL_DTC=		dtc
 TOOL_EQN=		eqn
 TOOL_FDISK=		fdisk
 TOOL_FGEN=		fgen
+TOOL_FILE=		file
 TOOL_GENASSYM=		genassym
 TOOL_GENCAT=		gencat
 TOOL_GMAKE=		gmake

Index: src/sys/arch/evbppc/compile/walnut-mkimg.sh
diff -u src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.5 src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.6
--- src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.5	Mon Mar  3 18:25:14 2014
+++ src/sys/arch/evbppc/compile/walnut-mkimg.sh	Wed Dec 11 00:06:58 2024
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: walnut-mkimg.sh,v 1.5 2014/03/03 18:25:14 joerg Exp $
+# $NetBSD: walnut-mkimg.sh,v 1.6 2024/12/11 00:06:58 maya Exp $
 
 # Convert an input to a TFTP image loadable by the IBM PowerPC OpenBIOS.
 
@@ -19,11 +19,13 @@ output=$1; shift
 : ${OBJDUMP=objdump}
 : ${OBJCOPY=objcopy}
 : ${STAT=stat}
+: ${AWK=awk}
+: ${FILE=file}
 
-file=$( file $input )
+file=$( ${FILE} $input )
 case $file in
 *:\ ELF\ *)
-	start=`${OBJDUMP} -f ${input} | awk '/start address/ { print $NF }'`
+	start=`${OBJDUMP} -f ${input} | ${AWK} '/start address/ { print $NF }'`
 	start=`printf "%d" $start`
 	${OBJCOPY} -O binary ${input} ${input}.bin.$$
 	;;

Reply via email to