---
name: "bsd.port.arch.mk"
section: "5"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/bsd.port.arch.mk"
---

# bsd.port.arch.mk(5)

ports tree Makefile fragment, concerned with arch issues

## NAME

**bsd.port.arch.mk** – ports tree Makefile fragment, concerned with arch issues

## SYNOPSIS

```
# 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)](/bsd.port.mk/5.md), 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)](/make/1.md) 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)](/bsd.port.mk/5.md).

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

## SEE ALSO

[bsd.port.mk(5)](/bsd.port.mk/5.md)

## HISTORY

**bsd.port.arch.mk** was split from [bsd.port.mk(5)](/bsd.port.mk/5.md) in OpenBSD 5.1.
