buildflags.awk man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

BUILDFLAGS.AWK(1)	  BSD General Commands Manual	     BUILDFLAGS.AWK(1)

NAME
     buildflags.awk — convert buildflags.conf(1) files into make syntax

SYNOPSIS
     buildflags.awk file

DESCRIPTION
     The buildflags.awk script converts a buildflags.conf(1) file into valid
     make syntax. The script can normally be found under '%%DATADIR%%/build‐
     flags.awk'.

     This is not end user documentation, if you just want to use build‐
     flags.conf files please refer to the buildflags.conf(1) manual page.

SYNTAX
     While the buildflags.conf(1) man page describes how to use the build‐
     flags.conf syntax, this page describes the resulting make syntax. Syntax
     examples will always be followed by the resulting make code. The term
     space actually refers to all spacing characters (including tabs).

   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.

     EXAMPLE

	   %%PORTS%%/audio/arts	   {IGNORE} # I do not want this, ever!

     RESULT

	   # I do not want this, ever!
	   .if ${.CURDIR:M%%PORTS%%/audio/arts}
	   IGNORE=		   yes
	   .endif

   DIRECTIVES
     Apart from behing put behind trailing comments native make(1) directives
     remain entirely unchanged. Native directives are everything that begins
     with a '.'.

     EXAMPLE

	   %%PORTS%%/* {
		   .if defined(WANT_I386)
			   CFLAGS+=	   -m32
			   LDCONFIG+=	   -32
		   .endif
	   }

     RESULT

	   .if ${CURDIR:M%%PORTS%%/*}
	   .if defined(WANT_I386)
	   CFLAGS+=	   -m32
	   LDCONFIG+=	   -32
	   .endif
	   .endif

   QUOTES
     Unless part of a comment quotes always have to follow a variable assign‐
     ment.  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 fun‐
     tion.

     EXAMPLE

	   # " in a comment does not matter.
	   BUT= "  in an
		   assignment
		   does"
	   CFLAGS="-O2 -pipe" # We want optimized binaries!

     RESULT

	   # " in a comment does not matter.
	   BUT= "  in an
		   assignment
		   does"
	   # We want optimized binaries!
	   CFLAGS="-O2 -pipe"

   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. Several paths can be appended
     with '&' (logical and) and '|' (logical or).

     After the location a block is opened by the character '{' and closed by
     the character '}'.

     EXAMPLE

	   %%PORTS%%/* & !*/work/*{
		   */x11*  {IGNORE}
	   }

     RESULT

	   .if ${.CURDIR:M%%PORTS%%/*} && !${.CURDIR:M*/work/*}
	   .if ${.CURDIR:M*/x11*}
	   IGNORE=		   yes
	   .endif
	   .endif

   VARIABLES
     For buildflags.awk 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.

     Compact variable assignments are directly followed by their value, with‐
     out any spaces 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.

     Long variable assignments are followed by spaces and the only way to end
     them without a line break is a '}'.

     EXAMPLE

	   THREADS=4
	   CPUTYPE?=p3 CFLAGS= -O2 -pipe
	   /usr/src{CPUTYPE=i686 CFLAGS= -O -pipe}

     RESULT

	   THREADS=4
	   CPUTYPE?=p3
	   CFLAGS= -O2 -pipe
	   .if ${.CURDIR:M/usr/src}
	   CPUTYPE=i686
	   CFLAGS= -O -pipe
	   .endif

   FLAGS
     There are two kinds of flags, negated flags and regular flags.

     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.

     Negated flags are a way to undefine variables. To do so simply precede a
     flag name with '!'.

     EXAMPLE

	   !THREADS WITHOUT_BDB

     RESULT

	   .undef THREADS
	   WITHOUT_BDB=		   yes

COMPATIBILITY
     The script has been tested on FreeBSD 7.2-PRERELEASE.

SEE ALSO
     buildflags.conf(1), buildflags.mk(1), bsdadminscripts(1)

HISTORY
     The buildflags.awk script first appeared in the bsdadminscripts-2.1 col‐
     lection.

AUTHOR
     Dominic Fandrey <kamikaze@bsdforen.de>

BSD				April 23, 2009				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net