1.\" $OpenBSD: bsd.port.arch.mk.5,v 1.14 2024/05/16 09:52:58 sthen Exp $ 2.\" 3.\" Copyright (c) 2011 Marc Espie 4.\" 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd $Mdocdate: May 16 2024 $ 28.Dt BSD.PORT.ARCH.MK 5 29.Os 30.Sh NAME 31.Nm bsd.port.arch.mk 32.Nd ports tree Makefile fragment, concerned with arch issues 33.Sh SYNOPSIS 34.Bd -literal 35# Set up such as 36MULTI_PACKAGES = -main -special 37ONLY_FOR_ARCHS-special = i386 38.Ed 39.Pp 40.Fd .include <bsd.port.arch.mk> 41.Bd -literal 42#some more lines such as 43\&.if ${BUILD_PACKAGES:M-special} 44CONFIGURE_ARGS += --enable-special 45\&.endif 46.Ed 47.Pp 48.Fd .include <bsd.port.mk> 49.Sh DESCRIPTION 50.Nm 51holds the logic used for arch-dependent builds in the ports tree. 52It is normally included as part of the larger 53.Xr bsd.port.mk 5 , 54but it is also available separately for ports that require it. 55.Bl -bullet 56.It 57multi-packages ports that need to remove some subpackages based 58on pseudo-flavors or architecture constraints. 59.It 60ports that need to make explicit tests on arch-dependent constants. 61.El 62.Pp 63.Nm 64assumes the following variables are already defined: 65.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub> 66.It MULTI_PACKAGES 67.It FLAVOR 68.It FLAVORS 69.It PSEUDO_FLAVORS 70.It Ev NOT_FOR_ARCHS[-<sub>] 71.It Ev ONLY_FOR_ARCHS[-<sub>] 72.El 73and optionally, if the default won't be appropriate 74.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub> 75.It Ev IGNORE[-<sub>] 76.El 77.Pp 78It will set up the following variables for use in the rest of the 79.Pa Makefile : 80.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub> 81.It Ev ARCH 82.It Ev ALL_ARCHS 83.It Ev APM_ARCHS 84.It Ev BE_ARCHS 85.It Ev CLANG_ARCHS 86.It Ev COMPILER_VERSION 87.It Ev CX11_ARCHS 88.It Ev DEBUGINFO_ARCHS 89.It Ev GCC3_ARCHS 90.It Ev GCC4_ARCHS 91.It Ev GCC49_ARCHS 92.It Ev GO_ARCHS 93.It Ev LE_ARCHS 94.It Ev LIBCXX 95.It Ev LLD_ARCHS 96.It Ev LLD_EMUL 97.It Ev LLVM_ARCHS 98.It Ev LP64_ARCHS 99.It Ev LUAJIT_ARCHS 100.It Ev MONO_ARCHS 101.It Ev OCAML_NATIVE_ARCHS 102.It Ev OCAML_NATIVE_DYNLINK_ARCHS 103.It Ev PROPERTIES 104.It Ev RUST_ARCHS 105.It Ev IGNORE-<sub> 106.It Ev BUILD_PACKAGES 107.El 108.Pp 109Most importantly, 110.Ev BUILD_PACKAGES 111will be correctly set up, taking 112.Ev ONLY_FOR_ARCHS[-<sub>] 113and 114.Ev NOT_FOR_ARCHS[-<sub>] 115limitations into account, as well as pseudo-flavors. 116.Pp 117Note that thanks to the way 118.Xr make 1 119variables are evaluated, a setup such as 120.Bd -literal -offset indent 121ONLY_FOR_ARCHS-foo = ${LP64_ARCHS} 122\&.include <bsd.port.arch.mk> 123.Ed 124.Pp 125is perfectly admissible, since 126.Ev ONLY_FOR_ARCHS-foo 127will be used only after 128.Ev LP64_ARCHS 129is defined. 130.Pp 131Also, you do not need to explicitly include 132.Pa bsd.port.arch.mk 133just to define 134.Bd -literal -offset indent 135ONLY_FOR_ARCHS = ${LP64_ARCHS} 136.Ed 137.Pp 138since 139.Pa bsd.port.mk 140does define arch constants before evaluating 141.Ev ONLY_FOR_ARCHS . 142A more detailed description of each variable is available in 143.Xr bsd.port.mk 5 . 144.Pp 145All the constant values 146.Ev ARCH , ALL_ARCHS , COMPILER_VERSION , 147.Ev GCC3_ARCHS , GCC4_ARCHS , LP64_ARCHS 148and 149.Ev PROPERTIES 150are also available from 151.Ev MODULES 152and from 153.Pa ${.CURDIR}/../Makefile.inc . 154.Sh SEE ALSO 155.Xr bsd.port.mk 5 156.Sh HISTORY 157.Nm 158was split from 159.Xr bsd.port.mk 5 160in 161.Ox 5.1 . 162