1.\" $OpenBSD: bsd.port.arch.mk.5,v 1.9 2016/03/22 16:02:02 naddy 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: March 22 2016 $ 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 COMPILER_VERSION 86.It Ev GCC3_ARCHS 87.It Ev GCC4_ARCHS 88.It Ev LE_ARCHS 89.It Ev LP64_ARCHS 90.It Ev PROPERTIES 91.It Ev IGNORE-<sub> 92.It Ev BUILD_PACKAGES 93.El 94.Pp 95Most importantly, 96.Ev BUILD_PACKAGES 97will be correctly set up, taking 98.Ev ONLY_FOR_ARCHS[-<sub>] 99and 100.Ev NOT_FOR_ARCHS[-<sub>] 101limitations into account, as well as pseudo-flavors. 102.Pp 103Note that thanks to the way 104.Xr make 1 105variables are evaluated, a setup such as 106.Bd -literal -offset indent 107ONLY_FOR_ARCHS-foo = ${LP64_ARCHS} 108\&.include <bsd.port.arch.mk> 109.Ed 110.Pp 111is perfectly admissible, since 112.Ev ONLY_FOR_ARCHS-foo 113will be used only after 114.Ev LP64_ARCHS 115is defined. 116.Pp 117Also, you do not need to explicitly include 118.Pa bsd.port.arch.mk 119just to define 120.Bd -literal -offset indent 121ONLY_FOR_ARCHS = ${LP64_ARCHS} 122.Ed 123.Pp 124since 125.Pa bsd.port.mk 126does define arch constants before evaluating 127.Ev ONLY_FOR_ARCHS . 128A more detailed description of each variable is available in 129.Xr bsd.port.mk 5 . 130.Pp 131All the constant values 132.Ev ARCH , ALL_ARCHS , COMPILER_VERION , 133.Ev GCC3_ARCHS , GCC4_ARCHS , LP64_ARCHS 134and 135.Ev PROPERTIES 136are also available from 137.Ev MODULES 138and from 139.Pa ${.CURDIR}/../Makefile.inc . 140.Sh SEE ALSO 141.Xr bsd.port.mk 5 142.Sh HISTORY 143.Nm 144was split from 145.Xr bsd.port.mk 5 146in 147.Ox 5.1 . 148