summaryrefslogtreecommitdiff
path: root/devel/cpuflags/files/cpuflags.1
blob: e5a9f0bda417bb70b836ae3f5e73104df9bb4f76 (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
58
59
60
61
62
.\"	$NetBSD: cpuflags.1,v 1.9 2002/10/17 11:36:44 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, plus add CPU_FLAGS and CPU_DIR to .MAKEFLAGS for sub-makes.
.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 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
.Pp
On all except low memory machines compliation can be speeded up by adding the
following to /etc/mk.conf. (Note this will not affect the binaries produced)
.Bd -literal -offset indent
COPTS+=-pipe
CFLAGS+=-pipe
.Ed
.Sh BUGS
.Nm
still needs to learn about more cpu types - updates welcomed
to <abs@netbsd.org>.
.Pp
Currently
.Nm
is also gcc specific.