xref: /openbsd/share/man/man5/bsd.port.arch.mk.5 (revision cecf84d4)
1.\" $OpenBSD: bsd.port.arch.mk.5,v 1.8 2013/08/10 10:17:36 miod 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: August 10 2013 $
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 NO_SHARED_LIBS
76.It Ev IGNORE[-<sub>]
77.El
78.Pp
79It will set up the following variables for use in the rest of the
80.Pa Makefile :
81.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
82.It Ev ARCH
83.It Ev ALL_ARCHS
84.It Ev APM_ARCHS
85.It Ev BE_ARCHS
86.It Ev COMPILER_VERSION
87.It Ev GCC3_ARCHS
88.It Ev GCC4_ARCHS
89.It Ev LE_ARCHS
90.It Ev LP64_ARCHS
91.It Ev NO_SHARED_ARCHS
92.It Ev NO_SHARED_LIBS
93.It Ev PROPERTIES
94.It Ev IGNORE-<sub>
95.It Ev BUILD_PACKAGES
96.El
97.Pp
98Most importantly,
99.Ev BUILD_PACKAGES
100will be correctly set up, taking
101.Ev ONLY_FOR_ARCHS[-<sub>]
102and
103.Ev NOT_FOR_ARCHS[-<sub>]
104limitations into account, as well as pseudo-flavors.
105.Pp
106Note that thanks to the way
107.Xr make 1
108variables are evaluated, a setup such as
109.Bd -literal -offset indent
110ONLY_FOR_ARCHS-foo = ${LP64_ARCHS}
111\&.include <bsd.port.arch.mk>
112.Ed
113.Pp
114is perfectly admissible, since
115.Ev ONLY_FOR_ARCHS-foo
116will be used only after
117.Ev LP64_ARCHS
118is defined.
119.Pp
120Also, you do not need to explicitly include
121.Pa bsd.port.arch.mk
122just to define
123.Bd -literal -offset indent
124ONLY_FOR_ARCHS = ${LP64_ARCHS}
125.Ed
126.Pp
127since
128.Pa bsd.port.mk
129does define arch constants before evaluating
130.Ev ONLY_FOR_ARCHS .
131A more detailed description of each variable is available in
132.Xr bsd.port.mk 5 .
133.Pp
134All the constant values
135.Ev ARCH , ALL_ARCHS , COMPILER_VERION ,
136.Ev GCC3_ARCHS , GCC4_ARCHS , LP64_ARCHS , NO_SHARED_ARCHS
137and
138.Ev PROPERTIES
139are also available from
140.Ev MODULES
141and from
142.Pa ${.CURDIR}/../Makefile.inc .
143Note that due to historical accident,
144.Ev NO_SHARED_LIBS
145is not such a constant.
146Test
147.Ev PROPERTIES
148to assert whether a given platform supports shared libraries.
149.Sh SEE ALSO
150.Xr bsd.port.mk 5
151.Sh HISTORY
152.Nm
153was split from
154.Xr bsd.port.mk 5
155in
156.Ox 5.1 .
157