Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 1FF2F84CD8 for ; Tue, 27 Jun 2023 10:36:41 +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 odmSdxcqnQc3 for ; Tue, 27 Jun 2023 10:36:40 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 8005F84CCC for ; Tue, 27 Jun 2023 10:36:40 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 7DDE3FA89; Tue, 27 Jun 2023 10:36:40 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1687862200211540" MIME-Version: 1.0 Date: Tue, 27 Jun 2023 10:36:40 +0000 From: "Taylor R Campbell" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Approved: commit_and_comment Reply-To: riastradh@netbsd.org X-Mailer: log_accum Message-Id: <20230627103640.7DDE3FA89@cvs.NetBSD.org> This is a multi-part message in MIME format. --_----------=_1687862200211540 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: riastradh Date: Tue Jun 27 10:36:40 UTC 2023 Modified Files: pkgsrc/mk: bsd.prefs.mk Log Message: bsd.prefs.mk: Define _CROSS_DESTDIR before platform/${OPSYS}.mk. This way, platform/${OPSYS}.mk has the opportunity to refer to it to query characteristics of the operating system that we're building packages for. Step on the way to cross-OS builds. To generate a diff of this commit: cvs rdiff -u -r1.433 -r1.434 pkgsrc/mk/bsd.prefs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1687862200211540 Content-Disposition: inline Content-Length: 2577 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/bsd.prefs.mk diff -u pkgsrc/mk/bsd.prefs.mk:1.433 pkgsrc/mk/bsd.prefs.mk:1.434 --- pkgsrc/mk/bsd.prefs.mk:1.433 Tue Jun 27 10:27:20 2023 +++ pkgsrc/mk/bsd.prefs.mk Tue Jun 27 10:36:40 2023 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.433 2023/06/27 10:27:20 riastradh Exp $ +# $NetBSD: bsd.prefs.mk,v 1.434 2023/06/27 10:36:40 riastradh Exp $ # # This file includes the mk.conf file, which contains the user settings. # @@ -450,6 +450,28 @@ SHAREMODE?= ${DOCMODE} @${FALSE} .endif +# When cross-compilation support is requested, the following options +# must be specified as well or guessable: +# - MACHINE_ARCH is set to TARGET_ARCH if set. +# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. +# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR +# - DESTDIR support is required +# +# _CROSS_DESTDIR is set for internal use to avoid conditionalising +# the use. + +.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) +. if defined(TARGET_ARCH) +MACHINE_ARCH= ${TARGET_ARCH} +. endif +CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} +. if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) +PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" +. else +_CROSS_DESTDIR= ${CROSS_DESTDIR} +. endif +.endif + # Load the OS-specific definitions for program variables. Default to loading # the NetBSD ones if an OS-specific file doesn't exist. .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk) @@ -529,28 +551,6 @@ _MAKE_INSTALL_AS_ROOT?= yes _MAKE_PACKAGE_AS_ROOT?= yes # Whether to run the package target as root. -# When cross-compilation support is requested, the following options -# must be specified as well or guessable: -# - MACHINE_ARCH is set to TARGET_ARCH if set. -# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. -# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR -# - DESTDIR support is required -# -# _CROSS_DESTDIR is set for internal use to avoid conditionalising -# the use. - -.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) -. if defined(TARGET_ARCH) -MACHINE_ARCH= ${TARGET_ARCH} -. endif -CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} -. if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) -PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" -. else -_CROSS_DESTDIR= ${CROSS_DESTDIR} -. endif -.endif - # TOOLS_CROSS_DESTDIR is used for the libtool build to make a wrapper # that points at the cross-destdir as sysroot, without setting # _CROSS_DESTDIR because we're actually building a native package. --_----------=_1687862200211540--