QFCC(1)

NAME
qfcc - The QuakeForge Code Compiler

SYNOPSIS
qfcc [options] [files]

DESCRIPTION
qfcc compiles Ruamoko source into a form that the QuakeForge engine can understand.

OPTIONS
qfcc takes the following arguments:

--traditional
    Use traditional QuakeC syntax, semantics and “bugs”. Also implies the v6only code generation option. This is the default when using progs.src.

--advanced
    Use advanced Raumoko features. This is the default when using separate compilation.

-C, --code OPTION,...
    Set code generation options. See CODE GENERATION OPTIONS for details.

-c  Compile only, do not link. Can be used in either progs.src or separate compilation modes.

-D, --define SYMBOL[=VAL]
    Define a symbol for the preprocessor, if it is in use.

-F, --files
    Generate files.dat. This list is created by checking the parameters to the precache_* functions.

-g  Generate debugging info. Synonym for --code debug.

-h, --help
    Show summary of options.

-I DIR
    Add DIR to the list of directories for the preprocessor to search when looking for include files.

--include FILE
    Process FILE as if #include "FILE" appeared as the first line of the primary source file. See the cpp man page (-include) for details.

-L DIR
    Add DIR to the search path used for -l.

-l LIB
    Add libLIB.a to the list of libraries to be used for resolving undefined symbols. qfcc's libraries are really pak files of qfcc object files built using the pak utility.

-N, --notice OPTION,...
    Set notice options. See NOTICE OPTIONS for details.

-o, --output-file FILE
    Specify output file name.

-P, --progs-src FILE
    File to use instead of progs.src

-p, --strip-path NUM
    Strip NUM leading path elements from file names. eg. -p 3 will strip the output code.

-q, --quiet
    Inhibit some of qfcc's normal output.

-r  Incremental linking. Generate a larger object file from other object files and libraries.

-S, --save-temps
    Do not delete temporary files.

-s, --source DIR
    look for progs.src in DIR instead of the current directory.

-U, --undefine SYMBOL
    Undefine a preprocessor symbol, if the preprocessor is in use.

-V, --version
    Show the version of qfcc.

-v, --verbose
    Display more output than usual.

-W, --warn OPTION,...
    Set warning options. See WARNING OPTIONS for details.

-z  Compress object files when writing them. This is especially useful when creating libraries, especially if using the object oriented features, but can be quite slow.

--cpp CPPSPEC
    cpp execution command line. See CPP NAME for details.

CODE GENERATION OPTIONS
Code generation options are processed in the order of their appearance on the command line. Unsupported options are ignored. The following options are supported by qfcc's --code argument:

cow Allow assignment to initialized globals. In Quake-C and Ruamoko, a global that has been initialized to a value is not a variable, but a named constant. However, qcc never really enforced this. The cow option allows qfcc to gracefully cope with QuakeC source that assigns values to initialized globals in this manner. (also known as “copy on write”—never mind the bovine connotations)

debug
    Generate debug code for QuakeForge engines. The QuakeForge engine has the ability to load line number and other debugging information for use in diagnosing progs crashes. This option tells qfcc to generate this information. It is written to a secondary file with the extension “sym”—if your output file is “progs.dat”, the symbol file will be “progs.sym”.

short-circuit
    Generate short circuit code for logical operators (&& and ||). For A && B, if A is false, the expression is known to be false and the code for B will not be executed. Similar for A || B, but if A is true, the expression is known to be true and the code for B will not be executed. Defaults to off for traditional mode, and on for advanced mode.

fast-float
    Use float values directly in “if” statements. Defaults to on. This option is always enabled when using version 6 progs.

vector-calls
    Where a function is called with just a vector, this causes the function call to store three floats instead of one vector. This can save a good number of pr_globals where those vectors contain many duplicate coordinates but do not match entirly. However, this will generate slower code for such calls.

v6only
    Restrict the compiler to only version 6 progs (original Quake/QuakeWorld) features. This means that the compiled data file should be able to run on older servers, as long as you have not used any QuakeForge-specific built-in functions. Also disables some of the compiler's features (like integers and string manipulation support).

WARNING OPTIONS
Warning options are processed in the order of their appearance on the command line. Unsupported options are ignored. The following options are supported by qfcc's --warn argument:

cow Emit a warning when the source assigns a value to a named constant. See the description of the cow code option above for a description of what this means.

interface-check
    Emit a warning when a method is declared in an implementation but not in the interface for a class.

undef-function
    Emit a warning when a function is called, but has not yet been defined.

uninited-var
    Emit a warning when a variable is read from that has not been initalized to a value.

vararg-integer
    Emit a warning when a function that takes a variable number of arguments is passed a constant of an integer type.

error
    Promote warnings to errors.

Any of the above can be prefixed with no- to negate its meaning. There are also two special options:

all Turns on all warning options except error.

none
    Turns off all warning options except error.

NOTICE OPTIONS
Notices are used to flag code constructs that may have changed semantics but shouldn't be treated as warnings. They are also used for internal debugging purposes, so if you see any cryptic notices, please report them as a bug (normal notices should be fairly self-explanatory).

none
    Silences all notice messages.

warn
    Promote notices to warnings. If warnings are being treated as errors, so will notices.

CPP NAME
When preprocessing source files, qfcc calls cpp (the C preprocessor) with a configurable command line. This is useful when you wish to use an alternative preprocessor (though it must be command line compatible with cpp) or when qfcc has been misconfigured to call cpp incorrectly for your operating system. If the latter is the case, please report the details (operating system, detection methods, correct execution specification). The base default execution spec (on most Linux systems) is cpp %d -o %o %i. This spec is similar in concept to a printf string. The name of the program may be either absolute (eg /lib/cpp) or relative as the PATH will be searched. Available substitutions:

%d  Mainly for defines (-D, -U and -I) but %d will be replaced by all cpp options that qfcc will be passing.

%o  This will be replaced by the output file path. Could be either absolute or relative, depending on whether qfcc is deleting temporary files or not.

%i  This will be replaced by the input file path. Generally as given to qfcc.

FAQ

Where did the name Ruamoko come from?
    In Maori mythology, Ruamoko is the youngest child of Ranginui, the Sky-father, and Papatuanuku, the Earth-mother. Ruamoko is the god of volcanoes and earthquakes (Quake, get it?). For more information, see the Web site at <http://maori.com/kmst1.htm>.

qfcc hangs
    This is almost always caused by qfcc incorrectly invoking cpp. Using the --cpp option (refer to the CPP NAME section above), the correct method for invoking cpp can be specified. Once you have found this, please send the correct cpp command line, preferably along with the output of config.guess, to the team.

qfcc is singing a bad 80s rap song to me. What's going on?
    “ice ice baby” is QuakeForge-speak for “Internal Compiler Error”. It usually means there's a bug in qfcc, so please report it to the team.

qfcc is mooing at me. What's wrong with you people?
    The compiler doesn't like being treated like a slab of beef. Seriously, the code you are trying to compile is using constants as if they weren't. Normally, qfcc would just stop and tell the code to sit in the corner for a while, but you told it not to do that by passing the cow option to --code, so it has its revenge by mooing out a warning. Or something like that. To disable the warning, pass no-cow to --warn.

FILES
progs.src

SEE ALSO
quakeforge(1),pak(1)

AUTHORS
The original qcc program, for compiling the QuakeC language, was written by Id Software, Inc. The members of the QuakeForge Project have modified it to work with a new, but very similar language called Ruamoko.