bsd.port.arch.mk(5)

bsd.port.arch.mk5

Ports tree makefile fragment, concerned with arch issues

Usage

# 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>

Overview

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.

  • 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.

bsd.port.arch.mk assumes the following variables are already defined:

MULTI_PACKAGES
FLAVOR
FLAVORS
PSEUDO_FLAVORS
NOT_FOR_ARCHS[-<sub>]
ONLY_FOR_ARCHS[-<sub>]

and optionally, if the default won't be appropriate

IGNORE[-<sub>]

It will set up the following variables for use in the rest of the Makefile:

ARCH
ALL_ARCHS
APM_ARCHS
BE_ARCHS
CLANG_ARCHS
COMPILER_VERSION
CXX11_ARCHS
DEBUGINFO_ARCHS
GCC4_ARCHS
GO_ARCHS
LE_ARCHS
LIBCXX
LLD_ARCHS
LLD_EMUL
LLVM_ARCHS
LP64_ARCHS
LUAJIT_ARCHS
MONO_ARCHS
OCAML_NATIVE_ARCHS
OCAML_NATIVE_DYNLINK_ARCHS
PORTSGCC_ARCHS
PROPERTIES
RUST_ARCHS
IGNORE-<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.

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.

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).

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.

Releases

31 releases since OpenBSD 5.1; the text changed 10 times.

  1. 5.1
  2. 5.2
  3. 5.3–5.4
  4. 5.5–5.9
  5. 6.0–6.1
  6. 6.2–6.6
  7. 6.7–7.5
  8. 7.6–7.8
  9. 7.9
  10. 8.0
  11. 8.0

History

bsd.port.arch.mk was split from bsd.port.mk(5) in OpenBSD 5.1.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.