Received: by mail.netbsd.org (Postfix, from userid 605) id 0A36284EBB; Fri, 26 Jan 2024 03:17:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 3ABE284D08 for ; Fri, 26 Jan 2024 03:16:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id V75FZCr-ETf4 for ; Fri, 26 Jan 2024 03:16:58 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 798C684CEB for ; Fri, 26 Jan 2024 03:16:58 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 7442AFA42; Fri, 26 Jan 2024 03:16:58 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1706239018161110" MIME-Version: 1.0 Date: Fri, 26 Jan 2024 03:16:58 +0000 From: "Taylor R Campbell" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Reply-To: riastradh@netbsd.org X-Mailer: log_accum Message-Id: <20240126031658.7442AFA42@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1706239018161110 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: riastradh Date: Fri Jan 26 03:16:58 UTC 2024 Modified Files: pkgsrc/mk: endian.mk Log Message: mk/endian.mk: Make this work for cross-builds. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 pkgsrc/mk/endian.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1706239018161110 Content-Disposition: inline Content-Length: 1147 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/endian.mk diff -u pkgsrc/mk/endian.mk:1.10 pkgsrc/mk/endian.mk:1.11 --- pkgsrc/mk/endian.mk:1.10 Wed May 21 01:43:50 2014 +++ pkgsrc/mk/endian.mk Fri Jan 26 03:16:58 2024 @@ -1,4 +1,4 @@ -# $NetBSD: endian.mk,v 1.10 2014/05/21 01:43:50 obache Exp $ +# $NetBSD: endian.mk,v 1.11 2024/01/26 03:16:58 riastradh Exp $ # # Determine the endianness of the platform by checking header files. # @@ -27,6 +27,11 @@ BUILTIN_FIND_HEADERS._ENDIAN_H= endian.h _ENDIAN_H= /dev/null . endif +_MACHINE_ENDIAN_CPP= ${CCPATH:U${CC}} -E - +.if ${TOOLS_USE_CROSS_COMPILE:tl} == "yes" +_MACHINE_ENDIAN_CPP+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} +.endif + MACHINE_ENDIAN!= \ { ${ECHO} "\#if defined(__sgi)"; \ ${ECHO} "\# include "; \ @@ -39,7 +44,7 @@ MACHINE_ENDIAN!= \ ${ECHO} "\#define BYTE_ORDER 1234"; \ ${ECHO} "\#endif"; \ ${ECHO} "\#endif"; \ - ${ECHO} "BYTE_ORDER"; } | ${CCPATH:U${CC}} -E - | \ + ${ECHO} "BYTE_ORDER"; } | ${_MACHINE_ENDIAN_CPP} | \ { while read line; do \ case $$line in \ 1234) ${ECHO} "little"; exit 0 ;; \ --_----------=_1706239018161110--