xref: /openbsd-src/share/man/man5/bsd.port.arch.mk.5 (revision 4c1e55dc91edd6e69ccc60ce855900fbc12cf34f)
1.\" $OpenBSD: bsd.port.arch.mk.5,v 1.6 2012/06/04 18:42:13 pascal 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: June 4 2012 $
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.Nm
56assumes the following variables are already defined:
57.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
58.It MULTI_PACKAGES
59.It FLAVOR
60.It FLAVORS
61.It PSEUDO_FLAVORS
62.It Ev NOT_FOR_ARCHS-<sub>
63.It Ev ONLY_FOR_ARCHS-<sub>
64.El
65and optionally, if the default won't be appropriate
66.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
67.It Ev NO_SHARED_LIBS
68.It Ev IGNORE-<sub>
69.El
70.Pp
71It will set up the following variables for use in the rest of the
72.Pa Makefile :
73.Bl -tag -offset indent -compact -width ONLY_FOR_ARCH-<sub>
74.It Ev ARCH
75.It Ev ALL_ARCHS
76.It Ev APM_ARCHS
77.It Ev BE_ARCHS
78.It Ev COMPILER_VERSION
79.It Ev GCC2_ARCHS
80.It Ev GCC3_ARCHS
81.It Ev GCC4_ARCHS
82.It Ev LE_ARCHS
83.It Ev LP64_ARCHS
84.It Ev NO_SHARED_ARCHS
85.It Ev NO_SHARED_LIBS
86.It Ev PROPERTIES
87.It Ev IGNORE-<sub>
88.It Ev BUILD_PACKAGES
89.El
90.Pp
91Most importantly,
92.Ev BUILD_PACKAGES
93will be correctly set up, taking
94.Ev ONLY_FOR_ARCHS-<sub>
95and
96.Ev NOT_FOR_ARCHS-<sub>
97limitations into account, as well as pseudo-flavors.
98.Pp
99Note that thanks to the way
100.Xr make 1
101variables are evaluated, a setup such as
102.Bd -literal -offset indent
103ONLY_FOR_ARCHS-foo = ${LP64_ARCHS}
104.Ed
105.Pp
106is perfectly admissible, since it will be used only after
107.Ev LP64_ARCHS
108is defined.
109.Pp
110A more detailed description of each variable is available in
111.Xr bsd.port.mk 5 .
112.Pp
113All the constant values
114.Ev ARCH , ALL_ARCHS , COMPILER_VERION , GCC2_ARCHS ,
115.Ev GCC3_ARCHS , GCC4_ARCHS , LP64_ARCHS , NO_SHARED_ARCHS
116and
117.Ev PROPERTIES
118are also available from
119.Ev MODULES
120and from
121.Pa ${.CURDIR}/../Makefile.inc .
122Note that due to historical accident,
123.Ev NO_SHARED_LIBS
124is not such a constant.
125Test
126.Ev PROPERTIES
127to assert whether a given platform supports shared libraries.
128.Sh SEE ALSO
129.Xr bsd.port.mk 5
130.Sh HISTORY
131.Nm
132was split from
133.Xr bsd.port.mk 5
134in
135.Ox 5.1 .
136