BSD.PORT.ARCH.MK(5)
π NAME π
okay so bestie, meet bsd.port.arch.mk(5) from the File Formats Manual β the ports tree Makefile fragment thatβs literally concerned with arch issues. ngl, the way that this tiny file handles arch-dependent build logic is lowkey iconic π
No cap, this is the arch-aware little glue for the ports tree, and yes it ate.
β¨ SYNOPSIS β¨
Set it up such as:
# Set up such as
MULTI_PACKAGES = -main -special
ONLY_FOR_ARCHS-special = i386
.include <bsd.port.arch.mk>
#some more lines such as
.if ${BUILD_PACKAGES:M-special}
CONFIGURE_ARGS += --enable-special
.endif
.include <bsd.port.mk>
π DESCRIPTION π
bsd.port.arch.mk holds the logic used for arch-dependent builds in the ports tree. It is normally included as part of the larger bsd.port.mk(5), but it is also available separately for ports that require it. Itβs giving βsmall file, big arch energyβ β¨
Vibe check: itβs here for:
- multi-packages ports that need to remove some subpackages based on pseudo-flavors or architecture constraints.
- ports that need to make explicit tests on arch-dependent constants.
πΈ variables it assumes are already defined πΈ
bsd.port.arch.mk assumes the following variables are already defined:
MULTI_PACKAGESFLAVORFLAVORSPSEUDO_FLAVORSNOT_FOR_ARCHS[-<sub>]ONLY_FOR_ARCHS[-<sub>]
and optionally, if the default wonβt be appropriate:
IGNORE[-<sub>]
π variables it sets up for the rest of the Makefile π
It will set up the following variables for use in the rest of the Makefile:
ARCHALL_ARCHSAPM_ARCHSBE_ARCHSCLANG_ARCHSCOMPILER_VERSIONCX11_ARCHSDEBUGINFO_ARCHSGCC4_ARCHSGCC49_ARCHSGO_ARCHSLE_ARCHSLIBCXXLLD_ARCHSLLD_EMULLLVM_ARCHSLP64_ARCHSLUAJIT_ARCHSMONO_ARCHSOCAML_NATIVE_ARCHSOCAML_NATIVE_DYNLINK_ARCHSPROPERTIESRUST_ARCHSIGNORE-<sub>BUILD_PACKAGES
Most importantly, BUILD_PACKAGES will be correctly set up, taking ONLY_FOR_ARCHS[-<sub>] and NOT_FOR_ARCHS[-<sub>] limitations into account, as well as pseudo-flavors. Thatβs the main character right there π.
π¦ the make(1) variable evaluation note π¦
Note that thanks to the way make(1) variables are evaluated, a setup such as
ONLY_FOR_ARCHS-foo = ${LP64_ARCHS}
.include <bsd.port.arch.mk>
is perfectly admissible, since ONLY_FOR_ARCHS-foo will be used only after LP64_ARCHS is defined. iykyk π«
Also, you do not need to explicitly include bsd.port.arch.mk just to define
ONLY_FOR_ARCHS = ${LP64_ARCHS}
since bsd.port.mk does define arch constants before evaluating ONLY_FOR_ARCHS. A more detailed description of each variable is available in bsd.port.mk(5). fr fr.
π where those constants also live π
All the constant values ARCH, ALL_ARCHS, COMPILER_VERSION, GCC4_ARCHS, LP64_ARCHS and PROPERTIES are also available from MODULES and from ${.CURDIR}/../Makefile.inc. Literally convenient, bestie π«Ά
π SEE ALSO π
π HISTORY π
bsd.port.arch.mk was split from bsd.port.mk(5) in OpenBSD 5.1. Periodt.
π cute sign-off: this pageβs footer is giving Debian, dated October 24, 2025 β bye bestie, go build something iconic! π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2011 Marc Espie
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms