Ich habe einige man pages, die von man auch korrekt dargestellt werden. Wenn ich jedoch
# whatis buildflags.awk
eingebe (man page ist unten). Bekomme ich nur die Meldung "buildflags.awk: nothing appropriate". Meine Google Stichworte sind anscheinend schlecht gewählt, denn ich finde keine Lösung.
# whatis buildflags.awk
eingebe (man page ist unten). Bekomme ich nur die Meldung "buildflags.awk: nothing appropriate". Meine Google Stichworte sind anscheinend schlecht gewählt, denn ich finde keine Lösung.
Code:
.\"
.\" Copyright (c) 2006 Dominic Fandrey <lon_kamikaze@gmx.de>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"
.Dd July 17, 2006
.Dt BUILDFLAGS.AWK 1
.Os
.Sh NAME
.Nm buildflags.awk \- parse buildflags.conf files
.Sh SYNOPSIS
.Nm
file
.Sh DESCRIPTION
The
.Nm
script parses a buildflags.conf file into valid make syntax. The script can
normally be found under '/usr/local/share/bsdadminscripts/buildflags.awk'.
.Pp
This is not end user documentation, if you just want to use buildflags.conf
files please refer to the
.Xr buildflags.conf 1
man page.
.Sh SYNTAX
While the
.Xr buildflags.conf 1
man page describes how to use the buildflags.conf syntax, this page
describes the resulting make syntax. Syntax examples will always be followed
by the resulting make code. The term space acutlly refers to all spacing
characters (such as a tab).
.Ss COMMENTS
Unless they're enclosed by '"' comments have the highest priority in the
buildflags.conf syntax.
Comments that are found behind valid code will end up one line before it.
.Pp
EXAMPLE
.Bd -literal -offset indent
/usr/ports/audio/arts {IGNORE} # I do not want this, ever!
.Ed
.Pp
RESULT
.Bd -literal -offset indent
# I do not want this, ever!
\&.if ${.CURDIR:M/usr/ports/audio/arts}
IGNORE= yes
\&.endif
.Ed
.Ss QUOTES
Unless part of a comment quotes always have to follow a variable assignment.
Whatever lies within them will remain untouched, but there are no escape
sequences, thus there is no way to enclose a '"' within quotes. Only double
quotes have meaning, single quotes do not have a special funtion.
.Pp
EXAMPLE
.Bd -literal -offset indent
# " in a comment does not matter.
BUT= " in an
assignment
does"
CFLAGS="-O2 -pipe" # We want optimized binaries!
.Ed
.Pp
RESULT
.Bd -literal -offset indent
# " in a comment does not matter.
BUT= " in an
assignment
does"
# We want optimized binaries!
CFLAGS="-O2 -pipe"
.Ed
.Ss LOCATIONS
Locations are paths that are used to define where a variable assignment is
valid, this is achieved by make. This script will simply convert such location
blocks to a make '.if' statement. If possible symlinked paths will be
substituted with their physical paths. A '!' at the beginning of a path means
that is should not be matched.
.Pp
After the location a block is opened by the character '{' and closed by
the character '}'.
.Pp
EXAMPLE
.Bd -literal -offset indent
/usr/ports/*{!*/work/*{
*/x11* {IGNORE}
}}
.Ed
.Pp
RESULT
.Bd -literal -offset indent
\&.if ${.CURDIR:M/usr/ports/*}
\&.if !${.CURDIR:M*/work/*}
\&.if ${.CURDIR:M*/x11*}
IGNORE= yes
\&.endif
\&.endif
\&.endif
.Ed
.Ss VARIABLES
For
.Nm
there are two kinds of variable assignments. Compact variable assignments
and long variable assignments. Variable assignments within quotes are
directly dealt with by the quoting code.
.Pp
Compact variable assignments are directly followed by their value, without
any space behind the '=' and their value ends with the first space or line
break. This makes it possible to have several such assignments in a single
line. Any such assignment will be parsed into its own line, though.
.Pp
Long variable assignments are followed by space and the only way to end
them without a line break is a '}'.
.Pp
EXAMPLE
.Bd -literal -offset indent
THREADS=4
CPUTYPE?=p3 CFLAGS= -O2 -pipe
/usr/src{CPUTYPE=i686 CFLAGS= -O -pipe}
.Ed
.Pp
RESULT
.Bd -literal -offset indent
THREADS=4
CPUTYPE?=p3
CFLAGS= -O2 -pipe
\&.if ${.CURDIR:M/usr/src}
CPUTYPE=i686
CFLAGS= -O -pipe
\&.endif
.Ed
.Ss Flags
There are two kinds of flags, negated flags and regular flags.
.Pp
Regular flags are variable assignments assuming that the mostly used assignment
simply is 'yes'. To define a flag it is enough to put the flag name in an
appropriate place.
.Pp
Negated flags are a way to undefine variables. To do so simply precede a
flag name with '!'.
.Pp
EXAMPLE
.Bd -literal -offset indent
!THREADS WITHOUT_BDB
.Ed
.Pp
RESULT
.Bd -literal -offset indent
\&.undef THREADS
WITHOUT_BDB= yes
.Ed
.Sh COMPATIBILITY
The script has been tested on FreeBSD 6.1.
.Sh SEE ALSO
.Xr buildflags.conf 1 ,
.Xr buildflags.mk 1 ,
.Xr bsdadminscripts 1
.Sh HISTORY
The
.Nm
script first appeared in the bsdadminscripts-2.1 collection.
.Sh AUTHOR
Dominic Fandrey <lon_kamikaze@gmx.de>