Files
makronix/tools/pkgsrc-cross.mk.conf
T
lotherkandClaude Sonnet 5.5 6c714a0ea7 tools, Makefile, package lists: media (CD 2, CD 3), install tests, build VM, source sets, binary packages
make iso now also writes CD 2 (makronix set) and CD 3 (binary packages); make sourcesets/isosrc make the source sets and the DVD with them. tools: cd2.sh cd3.sh, install-simple.sh install-cgd.sh (end-to-end tests on the serial console), vmsh.sh devvm.sh (QEMU sessions, the kept build VM), vm-pkgbuild.sh vm-pkgcollect.sh (native pkgsrc builds), pkg-binaries.sh (the project's binary packages), host-nfs-setup.sh (NFS for the build VM; loopback-only through an nftables rule), makronix-distfiles.sh makronix-pins.sh msrc-stage.sh. Package lists: common, per platform, and binary.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 12:53:21 +00:00

103 lines
4.7 KiB
Plaintext

# pkgsrc cross configuration for the Makronix build.
#
# MAKRONIX_TOP is the root of the Makronix tree and must be in the environment
# of every bootstrap and package build (MAKRONIX_TOP=$PWD bmake ...): the paths
# below follow it, so the same file serves the development tree and the tree
# the source set unpacks to (/usr/msrc). Before 2026-11-06 they were
# absolute paths of the development machine.
#
# Used as a mk-fragment (bootstrap --mk-fragment), so it ends up in the
# bootstrap's mk.conf and every package build reads it. The toolchain and the
# sysroot come from this tree's own build.sh output, so package contents are
# built FOR the target and never for the host.
#
# TOOLDIR ${TOP}/build/obj/tooldir.<host> (cross gcc/ld/ar/strip)
# CROSS_DESTDIR ${TOP}/build/obj/destdir.<machine> (the target sysroot)
#
# Values are taken from what build.sh produced (build/obj/params: MACHINE=amd64,
# MACHINE_ARCH=x86_64, DISTRIBVER=11.99.9), not guessed.
#
# pkg_install, in two pieces -- the distinction is not cosmetic:
#
# * build side: pkgsrc's cross mode registers packages with the *native*
# pkg_add (mk/pkgformat/pkg/pkgformat-vars.mk: PKG_ADD is
# ${NATIVE_PKG_ADD_CMD}), pointed at ${CROSS_DESTDIR} with -p. That binary
# is built by pkgsrc's own bootstrap from pkgsrc/pkgtools/pkg_install/files,
# not taken from the host's package manager; this host has no NetBSD pkg
# tools and none are installed from the distribution.
# * target side: no pkgsrc pkg_install. pkgtools/pkg_install cannot be
# cross-built -- its libnbcompat dependency runs configure test programs
# ("cannot run test program while cross compiling") -- and it would only
# duplicate the one in base. Makronix's pkg_add/pkg_info come from the
# distribution itself (src/usr.sbin/pkg_install, built by build.sh and
# shipped in the base set).
#
# pkgsrc's doc/HOWTO-use-crosscompile says "XXX This currently works only for
# NetBSD" about the *host*; the mechanism it describes (TOOLDIR + CROSS_DESTDIR
# + the cross toolchain from build.sh) does not depend on the host's OS, and
# this tree's build.sh already builds that toolchain on Linux.
USE_CROSS_COMPILE?= yes
TOOLDIR!= ls -d ${MAKRONIX_TOP}/build/obj/tooldir.* 2>/dev/null | head -1
CROSS_DESTDIR= ${MAKRONIX_TOP}/build/obj/destdir.amd64
# Every variable in CROSSVARS must be present or bsd.prefs.mk stops with
# "USE_CROSS_COMPILE=yes but missing cross variable settings".
CROSS_MACHINE_ARCH= x86_64
CROSS_OPSYS= NetBSD
CROSS_OS_VERSION= 11.99.9
# bsd.prefs.mk computes OPSYS_VERSION as printf "%02d%02d%02d" of
# major/minor/patch: 11.99.9 -> 119909.
CROSS_OPSYS_VERSION= 119909
CROSS_LOWER_OPSYS= netbsd
CROSS_LOWER_OPSYS_VERSUFFIX=
CROSS_LOWER_VARIANT_VERSION=
CROSS_LOWER_VENDOR=
CROSS_LOWER_OS_VARIANT=
CROSS_OBJECT_FMT= ELF
CROSS_LOCALBASE= /usr/pkg
CROSS_SYSCONFBASE= /etc
CROSS_VARBASE= /var
# X comes from the NetBSD tree, not from an Xorg built beside it.
X11_TYPE= native
# "Native" means the target base, not the build host. bootstrap(8) on a Linux
# host writes PREFER_PKGSRC=yes (its comment: Debian's other package managers
# leak in), which is a statement about the host and wrong here: Makronix ships
# curses, zlib, expat, freetype, fontconfig and the X libraries in its own
# sets, and a second copy under /usr/pkg would be a duplicate, not a
# dependency. Upstream pkgsrc states exactly this for a NetBSD system with
# /usr/X11R7/lib/libX11.so (mk/defaults/mk.conf: PREFER_PKGSRC stays empty);
# it cannot state it for us because the probe looks at the host's /usr, so the
# fragment does. Packages whose base version is too old for
# BUILDLINK_API_DEPENDS still fall back to pkgsrc on their own.
PREFER_PKGSRC=
PREFER_NATIVE= yes
# Archives live outside the repository (AGENTS.md); work directories are build
# output and stay under build/ so a package build never dirties pkgsrc/.
# The archives: the Makronix-only set of them (tools/makronix-distfiles.sh) --
# distfiles/ at the top of the tree when the source set was unpacked, else
# build/distfiles where `makronix-distfiles.sh fetch' puts them.
.if exists(${MAKRONIX_TOP}/distfiles)
DISTDIR= ${MAKRONIX_TOP}/distfiles
.else
DISTDIR= ${MAKRONIX_TOP}/build/distfiles
.endif
WRKOBJDIR= ${MAKRONIX_TOP}/build/pkgsrc-work
PACKAGES= ${MAKRONIX_TOP}/build/packages
# Build as the invoking user; there is nothing to gain from setuid here and
# everything to lose when a cross build runs as root by accident.
UNPRIVILEGED= yes
# TOOLS THAT WOULD RUN ON THE TARGET are refused for a build host that is not
# NetBSD (mk/tools/replace.mk, check in mk/misc/can-be-built-here.mk). Those
# tools only see TARGET paths and never run here, so the check is skipped --
# the documented switch ("When defined, the checks in this file are skipped").
NO_SKIP= yes