summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cross/cross-libtool-base/Makefile6
-rw-r--r--doc/HOWTO-use-crosscompile35
-rw-r--r--mk/bsd.prefs.mk34
-rw-r--r--mk/compiler/gcc.mk4
-rw-r--r--mk/configure/gnu-configure.mk4
-rw-r--r--mk/cwrappers.mk8
-rw-r--r--mk/pkgformat/pkg/metadata.mk4
-rw-r--r--mk/tools/tools.FreeMiNT.mk10
-rw-r--r--mk/tools/tools.Minix.mk10
-rw-r--r--mk/tools/tools.NetBSD.mk10
-rw-r--r--mk/tools/tools.QNX.mk8
-rw-r--r--mk/wrapper/bsd.wrapper.mk8
-rw-r--r--x11/libdrm/Makefile4
13 files changed, 82 insertions, 63 deletions
diff --git a/cross/cross-libtool-base/Makefile b/cross/cross-libtool-base/Makefile
index 1d1571ac464..997588bfca0 100644
--- a/cross/cross-libtool-base/Makefile
+++ b/cross/cross-libtool-base/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/05/24 19:49:26 wiz Exp $
+# $NetBSD: Makefile,v 1.6 2022/04/04 11:23:06 riastradh Exp $
# XXX This is kludgerific copypasta of devel/libtool-base/Makefile for
# cross-compilation. Please make it go away!
@@ -31,12 +31,14 @@
###########################################################################
###########################################################################
+LIBTOOL_CROSS_COMPILE= yes
+
.include "../../devel/libtool/Makefile.common"
# XXX Tweaked for cross-compilation.
#PKGNAME= ${DISTNAME:S/-/-base-/}
PKGNAME= ${DISTNAME:S/^libtool-/cross-libtool-base-${MACHINE_ARCH}-/}
-PKGREVISION= 6
+PKGREVISION= 7
COMMENT= Generic shared library support script (the script itself)
diff --git a/doc/HOWTO-use-crosscompile b/doc/HOWTO-use-crosscompile
index 6986234c7b4..25656c078cc 100644
--- a/doc/HOWTO-use-crosscompile
+++ b/doc/HOWTO-use-crosscompile
@@ -1,7 +1,7 @@
Cross-compilation in pkgsrc (user's guide) -*- outline -*-
Taylor R. Campbell <riastradh@NetBSD.org>
-$NetBSD: HOWTO-use-crosscompile,v 1.8 2022/04/04 11:22:50 riastradh Exp $
+$NetBSD: HOWTO-use-crosscompile,v 1.9 2022/04/04 11:23:06 riastradh Exp $
The following steps enable you to build binary packages for a machine
architecture other than the one you are building on. For example, you
@@ -40,14 +40,8 @@ In addition to whatever else you want in your mk.conf for pkgsrc, add:
# which is a bug.
USE_CROSS_COMPILE?= yes
- .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
- # Specify the machine architecture of target packages.
- #
- # XXX This currently can't be set on the command line, which is a
- # bug.
- MACHINE_ARCH= powerpc
-
- # Point pkgsrc at the NetBSD tooldir and destdir.
+ # Point pkgsrc at the NetBSD tooldir and destdir. These are used
+ # only for cross-builds.
#
# XXX There is no obvious variable that is set to amd64 so that we
# could use
@@ -59,6 +53,13 @@ In addition to whatever else you want in your mk.conf for pkgsrc, add:
TOOLDIR= /usr/obj/tooldir.NetBSD-6.1-amd64
CROSS_DESTDIR= /usr/obj/destdir.evbppc
+ .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+ # Specify the machine architecture of target packages.
+ #
+ # XXX This currently can't be set on the command line, which is a
+ # bug.
+ MACHINE_ARCH= powerpc
+
# Put target work and packages in separate directories. (You might
# use OBJMACHINE=yes or WRKOBJDIR=/tmp/work.${MACHINE_ARCH} instead
# for the work directories.)
@@ -76,22 +77,6 @@ XXX Some variables, notably LOCALBASE and other paths that get baked
into packages, cannot currently be set differently for native and
target packages.
-* Work around libtool
-
-Libtool's build system is broken -- it misuses the GNU build system
-build/host/target settings. For now we need to kludge around it
-manually:
-
- $ cd /usr/pkgsrc/cross/cross-libtool-base
- $ make package
- $ pkg_add -m powerpc /usr/pkgsrc/packages.powerpc/All/cross-libtool-base-powerpc-2.4.2.tgz
-
-(This builds a libtool package for the target, and then installs the
-target package natively. This *shouldn't* work, and pkg_add normally
-refuses this, but it does work because libtool is a shell script, and
-`pkg_add -m powerpc' makes pkg_add pretend we are powerpc to suppress
-its refusal.)
-
* Make some packages
Now packages you build normally will be cross-compiled for the target:
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index eaf4dff2b63..b2973a8898c 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.416 2022/01/18 01:41:09 pho Exp $
+# $NetBSD: bsd.prefs.mk,v 1.417 2022/04/04 11:23:06 riastradh Exp $
#
# This file includes the mk.conf file, which contains the user settings.
#
@@ -337,6 +337,33 @@ MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${NATIVE_APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${NATIVE_APPEND_ABI}
MACHINE_GNU_PLATFORM?= ${MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${APPEND_ABI}
+#
+# cross-libtool is special -- it is built as a native package, but it
+# needs tools set up as if for a cross-compiled package because it
+# remembers the paths for use to later assist in cross-compiling other
+# packages.
+#
+# So normally TOOLS_USE_CROSS_COMPILE is the same as USE_CROSS_COMPILE,
+# but for cross-libtool, we set TOOLS_USE_CROSS_COMPILE=yes while doing
+# the rest of the native package build with USE_CROSS_COMPILE=no.
+#
+# This can't live inside the cross-libtool makefile because the
+# TARGET_ARCH / MACHINE_ARCH / NATIVE_MACHINE_ARCH switcheroo has to
+# happen in the middle of this file -- after NATIVE_MACHINE_ARCH is
+# determined, before MACHINE_ARCH is used for anything else.
+#
+.if !empty(LIBTOOL_CROSS_COMPILE:M[yY][eE][sS])
+. if !defined(TARGET_ARCH)
+PKG_FAIL_REASON+= "Must set TARGET_ARCH for cross-libtool."
+. endif
+MACHINE_ARCH:= ${TARGET_ARCH}
+_BUILD_DEFS.MACHINE_ARCH= ${NATIVE_MACHINE_ARCH}
+_BUILD_DEFS.MACHINE_GNU_ARCH= ${NATIVE_MACHINE_GNU_ARCH}
+TOOLS_USE_CROSS_COMPILE= yes
+.else
+TOOLS_USE_CROSS_COMPILE= ${USE_CROSS_COMPILE:Uno}
+.endif
+
# Needed to prevent an "install:" target from being created in bsd.own.mk.
NEED_OWN_INSTALL_TARGET=no
@@ -520,6 +547,11 @@ _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.
+TOOLS_CROSS_DESTDIR= ${CROSS_DESTDIR}
+
# Depends on MACHINE_ARCH override above
.if ${OPSYS} == "NetBSD"
# XXX NATIVE_OBJECT_FMT is a cop-out -- but seriously, who is going to
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index e3aef2b4430..34d68a97843 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.236 2022/03/13 06:26:57 nia Exp $
+# $NetBSD: gcc.mk,v 1.237 2022/04/04 11:23:06 riastradh Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@@ -668,7 +668,7 @@ _GCCBINDIR= ${_GCC_PREFIX}bin
.elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS])
_GCCBINDIR= ${_CC:H}
.endif
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
_GCC_BIN_PREFIX= ${MACHINE_GNU_PLATFORM}-
.endif
_GCC_BIN_PREFIX?= # empty
diff --git a/mk/configure/gnu-configure.mk b/mk/configure/gnu-configure.mk
index 6caf076b4f6..46be4a13eac 100644
--- a/mk/configure/gnu-configure.mk
+++ b/mk/configure/gnu-configure.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gnu-configure.mk,v 1.28 2020/05/23 12:11:33 rillig Exp $
+# $NetBSD: gnu-configure.mk,v 1.29 2022/04/04 11:23:06 riastradh Exp $
#
# Package-settable variables:
#
@@ -80,7 +80,7 @@ CONFIGURE_ARGS+= --libdir=${GNU_CONFIGURE_LIBDIR}
USE_GNU_CONFIGURE_HOST?= yes
.if !empty(USE_GNU_CONFIGURE_HOST:M[yY][eE][sS])
-. if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+. if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
CONFIGURE_ARGS+= --build=${NATIVE_MACHINE_GNU_PLATFORM:Q}
. else
CONFIGURE_ARGS+= --build=${MACHINE_GNU_PLATFORM:Q}
diff --git a/mk/cwrappers.mk b/mk/cwrappers.mk
index f5261b58349..390b33eecf9 100644
--- a/mk/cwrappers.mk
+++ b/mk/cwrappers.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cwrappers.mk,v 1.34 2022/04/04 11:22:50 riastradh Exp $
+# $NetBSD: cwrappers.mk,v 1.35 2022/04/04 11:23:06 riastradh Exp $
#
# This Makefile fragment implements integration of pkgtools/cwrappers.
@@ -37,7 +37,7 @@ CWRAPPERS_ALIASES.ld= ld
CWRAPPERS_ALIASES.libtool= libtool
CWRAPPERS_ALIASES.shlibtool= shlibtool
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
CWRAPPERS_ALIASES.cc+= ${CC:T}
CWRAPPERS_ALIASES.cxx+= ${CXX:T}
CWRAPPERS_ALIASES.ld+= ${LD:T}
@@ -101,8 +101,8 @@ generate-cwrappers:
. endfor
. endif
. endif
-. if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
- ${RUN}echo sysroot=${_CROSS_DESTDIR:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}}
+. if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
+ ${RUN}echo sysroot=${TOOLS_CROSS_DESTDIR:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}}
. endif
.endfor
diff --git a/mk/pkgformat/pkg/metadata.mk b/mk/pkgformat/pkg/metadata.mk
index cca49504aa7..8cbf952cbd7 100644
--- a/mk/pkgformat/pkg/metadata.mk
+++ b/mk/pkgformat/pkg/metadata.mk
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.32 2021/11/07 18:49:28 khorben Exp $
+# $NetBSD: metadata.mk,v 1.33 2022/04/04 11:23:07 riastradh Exp $
######################################################################
### The targets below are all PRIVATE.
@@ -36,7 +36,7 @@ DARWIN_REQUIRES_FILTER= ${CAT}
${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS}
${RUN}${MKDIR} ${.TARGET:H}
${RUN}${RM} -f ${.TARGET}.tmp
- ${RUN} (${_BUILD_DEFS:NPATH:@v@${ECHO} ${v}=${${v}:Q} ;@}) \
+ ${RUN} (${_BUILD_DEFS:NPATH:@v@${ECHO} ${v}=${_BUILD_DEFS.${v}:Q:U${${v}:Q}} ;@}) \
> ${.TARGET}.tmp
.if !empty(USE_LANGUAGES)
${RUN}${ECHO} "CC_VERSION=${CC_VERSION}" >> ${.TARGET}.tmp
diff --git a/mk/tools/tools.FreeMiNT.mk b/mk/tools/tools.FreeMiNT.mk
index 2a93943ae38..1aa8fc73fee 100644
--- a/mk/tools/tools.FreeMiNT.mk
+++ b/mk/tools/tools.FreeMiNT.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.FreeMiNT.mk,v 1.4 2014/03/06 07:34:20 uebayasi Exp $
+# $NetBSD: tools.FreeMiNT.mk,v 1.5 2022/04/04 11:23:07 riastradh Exp $
#
# System-supplied tools for the FreeMiNT operating system.
@@ -37,7 +37,7 @@ TOOLS_PLATFORM.gzip?= /usr/bin/gzip -nf ${GZIP}
TOOLS_PLATFORM.head?= /usr/bin/head
TOOLS_PLATFORM.hostname?= /bin/hostname
TOOLS_PLATFORM.id?= /usr/bin/id
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.install?= /usr/bin/install
.else
TOOLS_PLATFORM.install?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
@@ -58,7 +58,7 @@ TOOLS_PLATFORM.openssl?= /usr/bin/openssl
TOOLS_PLATFORM.patch?= /usr/bin/patch
TOOLS_PLATFORM.printf?= /usr/bin/printf
TOOLS_PLATFORM.pwd?= /bin/pwd
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.readelf?= /usr/bin/readelf
.else
TOOLS_PLATFORM.readelf?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
@@ -71,7 +71,7 @@ TOOLS_PLATFORM.sh?= /bin/sh
TOOLS_PLATFORM.sleep?= /bin/sleep
TOOLS_PLATFORM.soelim?= /usr/bin/soelim
TOOLS_PLATFORM.sort?= /bin/sort
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.strip?= /usr/bin/strip
.else
TOOLS_PLATFORM.strip?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
@@ -92,7 +92,7 @@ TOOLS_PLATFORM.xargs?= /usr/bin/xargs -r
TOOLS_PLATFORM.xgettext?= /usr/bin/xgettext
TOOLS_PLATFORM.yacc?= /usr/bin/yacc
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
. for _t_ in ar as ld nm objdump ranlib readelf strip
TOOLS_PATH.${MACHINE_GNU_PLATFORM}-${_t_}?= \
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-${_t_}
diff --git a/mk/tools/tools.Minix.mk b/mk/tools/tools.Minix.mk
index 5bb0c774682..23e8a9eb477 100644
--- a/mk/tools/tools.Minix.mk
+++ b/mk/tools/tools.Minix.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.Minix.mk,v 1.13 2018/11/12 13:34:39 jperkin Exp $
+# $NetBSD: tools.Minix.mk,v 1.14 2022/04/04 11:23:07 riastradh Exp $
#
# System-supplied tools for the Minix operating system.
@@ -43,7 +43,7 @@ TOOLS_PLATFORM.gzip?= /usr/bin/gzip -nf ${GZIP}
TOOLS_PLATFORM.head?= /usr/bin/head
TOOLS_PLATFORM.hostname?= /bin/hostname
TOOLS_PLATFORM.id?= /usr/bin/id
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.install?= /usr/bin/install
.else
TOOLS_PLATFORM.install?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
@@ -67,7 +67,7 @@ TOOLS_PLATFORM.patch?= /usr/bin/patch
TOOLS_PLATFORM.pax?= /bin/pax
TOOLS_PLATFORM.printf?= /usr/bin/printf
TOOLS_PLATFORM.pwd?= /bin/pwd
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.readelf?= /usr/bin/readelf
.else
TOOLS_PLATFORM.readelf?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
@@ -82,7 +82,7 @@ TOOLS_PLATFORM.shlock?= /usr/bin/shlock
TOOLS_PLATFORM.sleep?= /bin/sleep
TOOLS_PLATFORM.soelim?= /usr/bin/soelim
TOOLS_PLATFORM.sort?= /usr/bin/sort
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.strip?= /usr/bin/strip
.else
TOOLS_PLATFORM.strip?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
@@ -103,7 +103,7 @@ TOOLS_PLATFORM.xz?= /usr/bin/xz
TOOLS_PLATFORM.xzcat?= /usr/bin/xzcat
TOOLS_PLATFORM.yacc?= /usr/bin/yacc
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
. for _t_ in ar as ld nm objcopy objdump ranlib readelf strip
TOOLS_PATH.${MACHINE_GNU_PLATFORM}-${_t_}?= \
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-${_t_}
diff --git a/mk/tools/tools.NetBSD.mk b/mk/tools/tools.NetBSD.mk
index a33f29d6b16..e67e82c61c5 100644
--- a/mk/tools/tools.NetBSD.mk
+++ b/mk/tools/tools.NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.NetBSD.mk,v 1.69 2022/04/03 10:33:44 riastradh Exp $
+# $NetBSD: tools.NetBSD.mk,v 1.70 2022/04/04 11:23:07 riastradh Exp $
#
# System-supplied tools for the NetBSD operating system.
@@ -58,7 +58,7 @@ TOOLS_PLATFORM.head?= /usr/bin/head
TOOLS_PLATFORM.hostname?= /bin/hostname
TOOLS_PLATFORM.id?= /usr/bin/id
TOOLS_PLATFORM.ident?= /usr/bin/ident
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.install?= /usr/bin/install
.else
TOOLS_PLATFORM.install?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
@@ -101,7 +101,7 @@ TOOLS_PLATFORM.paxctl?= /usr/sbin/paxctl
.endif
TOOLS_PLATFORM.printf?= /usr/bin/printf
TOOLS_PLATFORM.pwd?= /bin/pwd
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.readelf?= /usr/bin/readelf
.else
TOOLS_PLATFORM.readelf?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
@@ -119,7 +119,7 @@ TOOLS_PLATFORM.shlock?= /usr/bin/shlock
TOOLS_PLATFORM.sleep?= /bin/sleep
TOOLS_PLATFORM.soelim?= /usr/bin/soelim
TOOLS_PLATFORM.sort?= /usr/bin/sort
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.strip?= /usr/bin/strip
.else
TOOLS_PLATFORM.strip?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
@@ -155,7 +155,7 @@ TOOLS_PLATFORM.xzcat?= /usr/bin/xzcat
.endif
TOOLS_PLATFORM.yacc?= /usr/bin/yacc
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
. for _t_ in ar as ld nm objcopy objdump ranlib readelf strip
TOOLS_PATH.${MACHINE_GNU_PLATFORM}-${_t_}?= \
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-${_t_}
diff --git a/mk/tools/tools.QNX.mk b/mk/tools/tools.QNX.mk
index 1a2d288e3ac..4a6cc9e48da 100644
--- a/mk/tools/tools.QNX.mk
+++ b/mk/tools/tools.QNX.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.QNX.mk,v 1.1 2015/07/04 07:15:22 ryoon Exp $
+# $NetBSD: tools.QNX.mk,v 1.2 2022/04/04 11:23:07 riastradh Exp $
#
# System-supplied tools for the QNX operating system.
@@ -55,7 +55,7 @@ TOOLS_PLATFORM.patch?= /usr/bin/patch
TOOLS_PLATFORM.pax?= /bin/pax
TOOLS_PLATFORM.printf?= /usr/bin/printf
TOOLS_PLATFORM.pwd?= /bin/pwd
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.readelf?= ${QNX_HOST}/usr/bin/readelf
.endif
TOOLS_PLATFORM.rm?= /bin/rm
@@ -65,7 +65,7 @@ TOOLS_PLATFORM.sh?= /bin/sh
TOOLS_PLATFORM.sleep?= /usr/bin/sleep
TOOLS_PLATFORM.soelim?= ${QNX_HOST}/usr/bin/soelim
TOOLS_PLATFORM.sort?= /usr/bin/sort
-.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.strip?= ${QNX_HOST}/usr/bin/strip
.endif
TOOLS_PLATFORM.tail?= /usr/bin/tail
@@ -85,7 +85,7 @@ TOOLS_PLATFORM.yacc?= ${QNX_HOST}/usr/bin/bison -y
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
. for _t_ in ar as ld nm objcopy objdump ranlib readelf strip
TOOLS_PATH.${MACHINE_GNU_PLATFORM}-${_t_}?= \
${QNX_HOST}/usr/bin/nto${MACHINE_GNU_PLATFORM}-${_t_}
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index 9d9cf40d076..fe06414a204 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.104 2022/03/13 06:26:57 nia Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.105 2022/04/04 11:23:07 riastradh Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -363,7 +363,7 @@ _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC}
_WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-irix-ld
.endif
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
_WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-cross-gcc
_WRAP_CMD_SINK.CPP= ${WRAPPER_TMPDIR}/cmd-sink-cross-cpp
_WRAP_CMD_SINK.CXX= ${WRAPPER_TMPDIR}/cmd-sink-cross-gxx
@@ -540,9 +540,9 @@ ${WRAPPER_TMPDIR}/${w}: ${WRAPPER_SRCDIR}/${w}
${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
.endfor
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS])
_WRAP_CROSS_GCC_FILTER+= ${SED} \
- -e "s|@CROSS_DESTDIR@|${_CROSS_DESTDIR:Q}|g" \
+ -e "s|@CROSS_DESTDIR@|${TOOLS_CROSS_DESTDIR:Q}|g" \
-e "s|@PREFIX@|${PREFIX:Q}|g"
${WRAPPER_TMPDIR}/cmd-sink-cross-gcc: ${WRAPPER_SRCDIR}/cmd-sink-cross-gcc
${RUN} ${MKDIR} ${.TARGET:H}
diff --git a/x11/libdrm/Makefile b/x11/libdrm/Makefile
index c792eab6aad..da5118f0a86 100644
--- a/x11/libdrm/Makefile
+++ b/x11/libdrm/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.99 2022/03/16 20:33:39 tnn Exp $
+# $NetBSD: Makefile,v 1.100 2022/04/04 11:23:07 riastradh Exp $
DISTNAME= libdrm-2.4.110
CATEGORIES= x11 graphics
@@ -38,7 +38,7 @@ SUBST_STAGE.atomic= pre-configure
SUBST_VARS.atomic= ATOMIC_OPS_CHECK
ATOMIC_OPS_CHECK= 0
-.if exists(${CROSS_DESTDIR}/usr/include/sys/atomic.h)
+.if exists(${_CROSS_DESTDIR}/usr/include/sys/atomic.h)
ATOMIC_OPS_CHECK= 1
.else
. include "../../devel/libatomic_ops/buildlink3.mk"