1 .\" $OpenBSD: bsd.port.arch.mk.5,v 1.7 2012/09/30 09:28:20 espie Exp $
3 .\" Copyright (c) 2011 Marc Espie
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
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.
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.
27 .Dd $Mdocdate: September 30 2012 $
28 .Dt BSD.PORT.ARCH.MK 5
32 .Nd ports tree Makefile fragment, concerned with arch issues
36 MULTI_PACKAGES = -main -special
37 ONLY_FOR_ARCHS-special = i386
40 .Fd .include <bsd.port.arch.mk>
42 #some more lines such as
43 \&.if ${BUILD_PACKAGES:M-special}
44 CONFIGURE_ARGS += --enable-special
48 .Fd .include <bsd.port.mk>
51 holds the logic used for arch-dependent builds in the ports tree.
52 It is normally included as part of the larger
54 but it is also available separately for ports that require it.
57 multi-packages ports that need to remove some subpackages based
58 on pseudo-flavors or architecture constraints.
60 ports that need to make explicit tests on arch-dependent constants.
64 assumes the following variables are already defined:
65 .Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
70 .It Ev NOT_FOR_ARCHS[-<sub>]
71 .It Ev ONLY_FOR_ARCHS[-<sub>]
73 and optionally, if the default won't be appropriate
74 .Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
79 It will set up the following variables for use in the rest of the
81 .Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
86 .It Ev COMPILER_VERSION
92 .It Ev NO_SHARED_ARCHS
101 will be correctly set up, taking
102 .Ev ONLY_FOR_ARCHS[-<sub>]
104 .Ev NOT_FOR_ARCHS[-<sub>]
105 limitations into account, as well as pseudo-flavors.
107 Note that thanks to the way
109 variables are evaluated, a setup such as
110 .Bd -literal -offset indent
111 ONLY_FOR_ARCHS-foo = ${LP64_ARCHS}
112 \&.include <bsd.port.arch.mk>
115 is perfectly admissible, since
116 .Ev ONLY_FOR_ARCHS-foo
117 will be used only after
121 Also, you do not need to explicitly include
124 .Bd -literal -offset indent
125 ONLY_FOR_ARCHS = ${LP64_ARCHS}
130 does define arch constants before evaluating
132 A more detailed description of each variable is available in
135 All the constant values
136 .Ev ARCH , ALL_ARCHS , COMPILER_VERION , GCC2_ARCHS ,
137 .Ev GCC3_ARCHS , GCC4_ARCHS , LP64_ARCHS , NO_SHARED_ARCHS
140 are also available from
143 .Pa ${.CURDIR}/../Makefile.inc .
144 Note that due to historical accident,
146 is not such a constant.
149 to assert whether a given platform supports shared libraries.