summaryrefslogtreecommitdiff
path: root/devel/cpuflags/files/cpuflags.1
blob: ce29546fc34c22c5ec07805c16447daecd870f62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.\"	$NetBSD: cpuflags.1,v 1.6 2002/01/03 11:54:47 abs Exp $
.Dd May 31, 2001
.Dt CPUFLAGS 1
.Os
.Sh NAME
.Nm cpuflags
.Nd determine compiler flags to best target current cpu
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
queries the current cpu type and gcc version, then outputs appropriate
compiler options to best target code for that cpu. If no options exist
to target the current cpu then nothing is output.
.Pp
In the event of the cpu not being recognised, a warning is sent to stderr.
.Sh ENVIRONMENT
The makefile fragment
.Pa /usr/pkg/share/mk/cpuflags.mk
will set the following
.Xr make 1
variables. The first two are explicitly added to MAKE_ENV, while MAKE_FLAGS
will have CCOPTIONS=${CPU_FLAGS}
.Bl -tag -width CPU_FLAGS -compact
.It
.It CPU_FLAGS
The output of cpuflags
.It CPU_DIR
CPU_FLAGS with spaces stripped (eg: for use in PACKAGES)
.It LOWER_CPU_DIR
As CPU_FLAGS but all in lower case
.It CFLAGS
Has CPU_FLAGS appended
.It CXXFLAGS
Has CPU_FLAGS appended
.El
.Sh FILES
.Bl -tag -width /usr/pkg/share/mk/cpuflags.mk -compact
.It /usr/pkg/share/mk/cpuflags.mk
for inclusion by /etc/mk.conf
.El
.Sh EXAMPLES
.Nm
can be used to set default flags for building entries from pkgsrc
and recompiling the
.Nx
kernel or userland by adding the following to /etc/mk.conf.
.Bd -literal -offset indent
 .sinclude "/usr/pkg/share/mk/cpuflags.mk"
.Ed
.Sh BUGS
.Nm
does not know about many cpu types yet - updates welcomed to <abs@netbsd.org>.
.Pp
Currently
.Nm
is also gcc specific.