xref: /openbsd/share/man/man5/bsd.port.arch.mk.5 (revision e5dd7070)
1.\" $OpenBSD: bsd.port.arch.mk.5,v 1.13 2019/12/08 12:54:36 espie 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: December 8 2019 $
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 MONO_ARCHS
100.It Ev OCAML_NATIVE_ARCHS
101.It Ev OCAML_NATIVE_DYNLINK_ARCHS
102.It Ev PROPERTIES
103.It Ev RUST_ARCHS
104.It Ev IGNORE-<sub>
105.It Ev BUILD_PACKAGES
106.El
107.Pp
108Most importantly,
109.Ev BUILD_PACKAGES
110will be correctly set up, taking
111.Ev ONLY_FOR_ARCHS[-<sub>]
112and
113.Ev NOT_FOR_ARCHS[-<sub>]
114limitations into account, as well as pseudo-flavors.
115.Pp
116Note that thanks to the way
117.Xr make 1
118variables are evaluated, a setup such as
119.Bd -literal -offset indent
120ONLY_FOR_ARCHS-foo = ${LP64_ARCHS}
121\&.include <bsd.port.arch.mk>
122.Ed
123.Pp
124is perfectly admissible, since
125.Ev ONLY_FOR_ARCHS-foo
126will be used only after
127.Ev LP64_ARCHS
128is defined.
129.Pp
130Also, you do not need to explicitly include
131.Pa bsd.port.arch.mk
132just to define
133.Bd -literal -offset indent
134ONLY_FOR_ARCHS = ${LP64_ARCHS}
135.Ed
136.Pp
137since
138.Pa bsd.port.mk
139does define arch constants before evaluating
140.Ev ONLY_FOR_ARCHS .
141A more detailed description of each variable is available in
142.Xr bsd.port.mk 5 .
143.Pp
144All the constant values
145.Ev ARCH , ALL_ARCHS , COMPILER_VERSION ,
146.Ev GCC3_ARCHS , GCC4_ARCHS , LP64_ARCHS
147and
148.Ev PROPERTIES
149are also available from
150.Ev MODULES
151and from
152.Pa ${.CURDIR}/../Makefile.inc .
153.Sh SEE ALSO
154.Xr bsd.port.mk 5
155.Sh HISTORY
156.Nm
157was split from
158.Xr bsd.port.mk 5
159in
160.Ox 5.1 .
161