PMKFILE(5)

NAME
pmkfile - pmk specification file

DESCRIPTION
pmkfile is a file containing specifications that help configuring a package build on a given platform.

DATA TYPES
pmkfile uses pseudo types like the following:

bool
    The classical boolean type with TRUE and FALSE values.

    For example:

        TRUE
        FALSE

identifier
    An identifier is a string of alphanumerical and underscores characters.

    For example:

        REQUIRED
        a_label
        underscores_are_nice

quoted
    This means quoted string which can contain a set of characters delimited by quotation marks.

    For examples:

        "simple quoted string"
        "string that contain \"quotes\" backslashed"
        "can also contain filenames like pmkfile.scan"

list
    It is one or more of the previous types between brackets. Multiple objects are separated with a comma. Blanks are currently not allowed beside commas, this means that you can find them only in a quoted string of the list.

    For example:

        ("only_one_string")
        ("added a boolean",TRUE)
        (mixed_list_of,"words","and",TRUE,"quoted strings")

SYNTAX
pmkfile can contain comments, blank lines and commands.

A command has the following format (? character means optional field):

    <command><?(label)> {
    	<body>
    }

The command and label names can be assimilated to the 'word' type. See DATA TYPES above.

The body can contain comment(s) and definition line(s). A commented line start with a '#' character like the following:

    # this is a comment line

A definition line has the following format:

    <?blank><key name><?blank>=<?blank><key value>

The key name is of identifier type.

The key value type can be 'bool', 'quoted' or 'list'. The right type will depend on the key name (see further).

For example:

    CHECK_INCLUDE(header_sys_param) {
    	# following options use different uses of blank characters
    	# key value is word type
    	REQUIRED = TRUE
    	# key value is list type
    	DEPEND=	("dep_one",dep_two,"dep_three")
    	# key value is quoted type
    	INCLUDE = "sys/param.h"
    }

SPECIFIC COMMANDS

The following commands have no label.

SETTINGS
    This command sets pmk parameters.

    Arguments:

    AC_COMPAT
        type is 'quoted', enable autoconf compatibility (empty string or filename).

    LANG
        type is 'quoted', global default language.

    TARGET
        type is 'list', list of target's filenames.

    DETECT
        type is 'list', list of compilers to detect (CC and/or CXX).

    For example:

        SETTINGS {
        	AC_COMPAT="config.h"
        	LANG="C"
        	TARGET=("src/file.c","src/file.h")
        	DETECT=("CC")
        }

DEFINE
    This command permits to define variables.

    Arguments:

        Those are the variables to be defined (quote data type only).

    For example:

        DEFINE {
        	PACKAGE="my_prog"
        	VERSION="0.1"
        }

SWITCHES
    This command is setting dependency switches (see further DEPEND definition).

    Arguments:

    For example:

        SWITCHES {
        	use_curses=TRUE
        	use_gtk=FALSE
        }

STANDARD COMMANDS

All these commands need a label.

They can all have the following optional arguments:

REQUIRED
    Specify if this test is required to achieve the configuration. Type is 'bool'. If not specified, it is TRUE by default.

DEPEND
    Specify check dependencies. Type is 'list'. A dependency is a label or a switch name. The value of each dependency can be negated by adding a leading '!' sign. If at least one of the dependencies is false then the check will be disabled.

    For example:

        DEPEND = ("header_gtk","!header_qt")

DEFS
    Specify additional defines. Type is 'list'. If the check succeeds then the given defines are also recorded else they are ignored.

Some of these commands can also have the following arguments:

LANG
    Specify the language used in the following list:

    C, C++

    Type is 'quoted', by default \"C\" is the used language.

Here the list of commands:

CHECK_BINARY
    Check if a binary is in the path.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    NAME
        type is 'quoted', name of the binary.

    VARIABLE
        type is 'quoted', variable name to store the path.

CHECK_HEADER
    Check language header and optionally a function.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    LANG

    NAME
        type is 'quoted', name of the header.

    MACRO
        type is 'list', list of one or more compiler macros to check, optional.

    FUNCTION
        type is 'quoted' or 'list', name or list of functions to check, optional.

    CFLAGS
        type is 'quoted', variable name to store CFLAGS values, optional.

CHECK_LIB
    Check a library and optionally a function.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    LANG

    NAME
        type is 'quoted', name of the library to check.

    FUNCTION
        type is 'quoted' or 'list', name or list of functions to check, optional.

    LIBS
        type is 'quoted', variable name to store LIBS values, optional.

CHECK_CONFIG
    Check using a *-config tool.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    NAME
        type is 'quoted', config tool name.

    VERSION
        type is 'quoted', minimal version needed, optional.

    CFLAGS
        type is 'quoted', variable name to store CFLAGS values, optional.

    LIBS
        type is 'quoted', variable name to store LIBS values, optional.

    VARIABLE
        type is 'quoted', variable name to store the path of the config tool, optional.

CHECK_PKG_CONFIG
    Check a package using pkg-config.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    NAME
        type is 'quoted', package name.

    VERSION
        type is 'quoted', minimal version needed, optional.

    CFLAGS
        type is 'quoted', variable name to store CFLAGS values, optional.

    LIBS
        type is 'quoted', variable name to store LIBS values, optional.

CHECK_TYPE
    Check if the given type exists.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    LANG

    NAME
        type is 'quoted', name of the type to check.

    HEADER
        type is quoted, name of the header where to find the given type.

    MEMBER
        type is quoted, name of a member of the structure given in NAME to be checked.

CHECK_VARIABLE
    Check if the given variable does exist and optionally its value.

    Arguments:

    REQUIRED

    DEPEND

    DEFS

    NAME
        type is 'quoted', name of the variable to check.

    VALUE
        type is 'quoted', value to check with the variable, optional.

CONDITIONAL COMMANDS

IF(expression)
    It contains other commands that will be executed only if the given expression is true.

    Arguments:

    For example:

        IF(header_gtk) {
        	DEFINE {
        		HAVE_GTK = "1"
        	}
        }

ELSE(expression)
    It contains other commands that will be executed only if the given expression is false.

    Arguments:

    For example:

        ELSE(header_glib) {
        	DEFINE {
        		HAVE_GLIB = "0"
        	}
        }

SHARED LIBRARY SUPPORT

BUILD_SHLIB_NAME
    This command helps you to build the name of a shared library.

    Arguments:

    NAME
        type is 'quoted', name of the library (without leading 'lib').

    MAJOR
        type is 'quoted', major number for the version.

    MINOR
        type is 'quoted', minor number for the version.

    VERSION_NONE
        type is 'quoted', variable name to store library name without version, optional.

    VERSION_MAJ
        type is 'quoted', variable name to store library name with major version, optional.

    VERSION_FULL
        type is 'quoted', variable name to store library name with full version, optional.

    For example,

        BUILD_SHLIB_NAME {
        	NAME = "test"
        	MAJOR = "0"
        	MINOR = "2"
        	VERSION_NONE = "LIBNAME"
        	VERSION_FULL = "LIBNAMEVERS"
        }

SEE ALSO
pmk(1), pmkscan(1)