Docs GODI Archive
Projects Blog Link DB

Look up function:

(e.g. "List.find" or "keysym")
More options
======================================================================
Reference for makefile variables
======================================================================

$Id: makevar-ref.txt 28 2005-06-02 15:47:13Z gerd $

The notation

var (flags)

means that for the variable "var" the annotations indicated by the
"flags" must be taken into consideration. List of flags:

- r: For a package "Makefile" this variable is read-only, i.e. it can
     be used, but it must not be modified

- w: For a package "Makefile" this variable is read-write

- c: configuration: This variable can be set in godi.conf

- f: preference: This variable is set by bsd.pref.mk, so you need only
     to include this makefile, not the whole of bsd.pkg.mk

- p: This variable is private for the make framework

- !: The meaning of the variable has changed, pay attention to which
     version of godi-core-mk interprets it in which way

======================================================================
Global configuration
======================================================================

PKGSRC_RUN_TEST (c)
    When "yes", package tests are enabled.

    (I don't know of any such test, however.)

GODI_BUILD_SITES (cf)
    A list of URLs where to find build.tgz files (build instructions).

GODI_BUILD_SITE (cf)
    The primary URL with build.tgz files. The primary URL is used during
    bootstrap. It is usually the first URL of GODI_BUILD_SITES.

GODI_SECTION (cf)
    The selected release line, e.g. 3.07. Changing this variable normally
    changes GODI_BUILD_SITES and GODI_BUILD_SITE implicitly, too.

MASTER_SITE_XCONTRIB
MASTER_SITE_GNU
MASTER_SITE_GNUSTEP
MASTER_SITE_PERL_CPAN
MASTER_SITE_R_CRAN
MASTER_SITE_TEX_CTAN
MASTER_SITE_SUNSITE
MASTER_SITE_GNOME
MASTER_SITE_SOURCEFORGE
MASTER_SITE_SUSE
MASTER_SITE_MOZILLA
MASTER_SITE_XEMACS
MASTER_SITE_APACHE
MASTER_SITE_DEBIAN
    Lists of URLs with mirrors for various open source projects.
    Use as in

    MASTER_SITE=${MASTER_SITE_GNU:=subdir/file.tar.gz}

    (This is a suffix substitution as in ${var:.cmo=.cmx}!)

MASTER_SITE_BACKUP
    Backup URLs of the GODI project

SEARCH_LIBS (cf)
    List of directories where to search for C libraries by default.
    This should be base directories in the sense that when /dir
    is in this list the libfoo.a file is found in /dir/lib, the
    include files are found in /dir/include etc.

    This variable is initialized with a reasonable default.
    If you set this variable in godi.conf, your settings are
    prepended to this default.

SEARCH_LIBS_OVERRIDE (cf)
    Same contents as SEARCH_LIBS, but overrides the search
    path completely (no default), that means SEARCH_LIBS does
    not have any effect.

SEARCH_CMDS (cf)  
    List of directories where GODI searches Unix utilities. This list
    is only used when godi-core-mk is configured ("Looking up system
    commands"). godi-core-mk uses the current value of this variable
    to determine the absolute paths of the Unix commands before this
    package is installed, and writes this value into cmd.defs.mk after
    this package is installed, just to have it for the next build. The
    initial value is written by the GODI bootstrap script.

    By setting this variable or appending to it in godi.conf, one can
    change the command path for the next time godi-core-mk will be
    installed. It does not have any further effect.

    The paths found out with the help of SEARCH_CMDS are usually only
    used by the GODI make framework, but not by the invoked upstream
    build scripts.

GODI_OVERRIDE_PREFS (cf)

WRKOBJDIR (c)
    Set this variable to the absolute name of a directory to
    configure that builds are performed in this directory. E.g.
    WRKOBJDIR=/tmp/godi

-- OS-specific --

OPSYS (cf)
    The base name of the operating system:
    Linux, SunOS, NetBSD, FreeBSD, OpenBSD, Darwin etc.

LOWER_OPSYS (cf)
    Same as OPSYS in lowercase letters

OS_VERSION (cf)
    The version as reported by uname

LOWER_OS_VERSION (cf)
    Same as OS_VERSION in lowercase letters

LOWER_VENDOR (cf)
    The vendor as reported by uname

MACHINE_ARCH (cf)

MACHINE_GNU_ARCH (cf)

MACHINE_GNU_PLATFORM (cf)

CREATE_SHLIBS (cf)
    see finding-libraries.txt

    Note when CREATE_SHLIBS is set and "no", C libraries must only
    be installed as static archives, and it must not be tried to
    create shared libraries.

    If unset, or not "no", C libraries should be installed as
    shared libraries.

    For O'Caml stub libraries, see GODI_HAVE_DLL, it has a similar
    meaning.

SHLIB_TYPE (cf)
    see finding-libraries.txt

ELF_RPATH (cf)
    see finding-libraries.txt

ELF_RPATH_FLAG (cf)
    see finding-libraries.txt

RPATH_FLAG (r)
    compatibility name for ELF_RPATH_FLAG


======================================================================
Directories
======================================================================

--- Global directories ---

LOCALBASE (rcf)
    The base directory where GODI is installed.

PREFIX (r)
    The base directory used for install time. Currently, this is
    always the same as LOCALBASE, but alternate installation
    methods might need it

GODI_DBDIR (rcf)
    The directory containing the package database

DISTDIR (rf)
    The "distfiles" directory (tarballs with sources)

PACKAGES (rf)
    The "packages" directory (binary packages)

--- Per-package directories ---

These variables are per package.

PKGDIR (r)
    The package directory containing the build instructions

WRKDIR (r)
    The "work" subdirectory in PKGDIR

WRKSRC (r)
    The directory with the unpacked package sources (usually below
    WRKDIR)

PATCHDIR (r)
    The directory containing patches, i.e. "patches" in PKGDIR

FILESDIR (r)
    The directory containing additional files, i.e. "files" in PKGDIR


======================================================================
O'Caml-specific global configuration
======================================================================

BUILD_OCAMLFIND

BUILD_OCAMLFIND_ENV


Note that the following options about the capabilities of the O'Caml
installation are meant as documention about available or missing
features. By setting them you cannot turn off these features! Build
scripts can test them, however, and build packages according to their
values.

GODI_HAVE_OCAMLOPT (r)
    "yes" or "no": whether there is an ocamlopt compiler

GODI_THREAD_MODEL (r)
    "bthr" or "pthr": "bthr" means that there is only the bytecode
    thread model, "pthr" means that both thread models are supported,
    bytecode threads and POSIX threads.

GODI_HAVE_DLL (r)
    "yes" or "no": whether O'Caml supports stub libraries that
    can be dynamically loaded into the running bytecode interpreter.

    When CREATE_SHLIBS=no, it is ensured this variable is also "no".

GODI_HAVE_PROF (r)
    "yes" or "no": whether the ocamlopt compiler supports gprof-
    style profiling

GODI_HAVE_OCAMLOPT_PACK (r)
    undefined or "yes" or "no": whether ocamlopt -pack is supported.
    This var is only defined for recent versions of godi-ocaml-src.
    When undefined, it is not known whether -pack is supported.

======================================================================
Utilities
======================================================================

These are (usually absolute) paths to utility programs, sometimes with
default arguments.

In Makefiles, the utilities must be called with these variables in
order to control which version is actually used (a number of OS have
several versions of the same utility).

We do not specify here exactly which version of the utilities can be
expected. As a rule of thumb, the Single Unix Specification can be
assumed. Note that GNU often has much more functionality which should
not be used, and that BSD often has a traditional interface which
should not be used, too. 

See also SEARCH_CMDS for how to change the search path for the
script that looks these commands up. Of course, it is also possible
to set these variables individually in godi.conf.


AR (cf)
    The ar utility

AWK (cf)
    The awk utility. One can assume nawk functionality.

BASENAME (cf)
    The basename utility

BZCAT (cf)
    The bzcat utility. This is optional.

CAT (cf)
    The cat utility

CHMOD (cf)
    The chmod utility

CMP (cf)
    The cmp utility
 
CP (cf)
    The cp utility

CPP_EXE (cf)
    Path to a stand-alone C preprocessor (for applications requiring
    one, such as rpcgen)

CUT (cf)
    The cut utility

DATE (cf)
    The date utility

DC (cf)
    The dc utility

DD (cf)
    The dd utility

DIGEST (cf)
    The digest utility. This is always the version installed at
    GODI bootstrap time.

DIRNAME (cf)
    The dirname utility

ECHO (cf)
    The echo utility

EGREP (cf)
    The egrep utility.
    CHECK: Is this actually used? Better transition to ${GREP} -E

EXPR (cf)
    The expr utility

FALSE (cf)
    The false utility

FETCH_CMD (cf)
    The utility to download files. Related:

    FETCH_BEFORE_ARGS (cf)
    FETCH_AFTER_ARGS (cf)
        Arguments for FETCH_CMD to place before the download URL, and
	after the download URL, resp.

    The download utility must have certain properties not described here.

FGREP (cf)
    The fgrep utility
    CHECK: Is this actually used? Better transition to ${GREP} -F

FILE_CMD (cf)
    The file utility

FIND (cf)
    The find utility

GCC (cf)
    How to invoke the GNU C-compiler. Defaults to "gcc" without path.
    E.g. add "-V" options to select certain version of the compiler.

    "gcc" must never be referenced by absolute path.

GMAKE (cf)
    The GNU make utility

GREP (cf)
    The grep utility

GTAR (cf)
    The tar utility. This is always the version installed at GODI
    bootstrap time.

GUNZIP_CMD (cf)
    The gunzip utility

GZIP_CMD (cf)
    The gzip utility

GZCAT (cf)
    The gzcat utility

HEAD (cf)
    The head utility

HOSTNAME_CMD (cf)
    The hostname utility

ID (cf)
    The id utility

INSTALL (cf)
    The BSD-compatible install utility. If the OS does not have one,
    the godi_install script is used instead

LDCONFIG (cf)
    The ldconfig utility, or "true" if the OS does not have one

LDD (cf)
    The ldd utility, or "true" if the OS does not have one

LN (cf)
    The ln utility

LS (cf)
    The ls utility

M4 (cf)
    The m4 utility

MKDIR (cf)
    The mkdir utility plus -p option

MV (cf)
    The mv utility

NM_EXE (cf)
    The nm utility

PATCH (cf)
    The patch utility

PAX (cf)
    The pax utility. This is always the version installed at GODI
    bootstrap time.

PKG_ADD (f)
    The godi_add program

PKG_ADMIN (f)
    The godi_admin program

PKG_CREATE (f)
    The godi_create program

PKG_DELETE (f)
    The godi_delete program

PKG_INFO (f)
    The godi_info program

PRINTF (cf)
    The printf utility

PS (cf)
    The ps utility.
    WHY IS THIS NEEDED?

PWD_CMD (cf)
    The pwd utility. It is ensured that the version of pwd is put in
    here that prints the physical path

RANLIB_EXE (cf)
    The ranlib utility, or "true" if the OS does not need this

RM (cf)
    The rm utility

RMDIR (cf)
    The rmdir utility

SED (cf)
    The sed utility

SETENV (cf)
    The env utility

SH (cf)
    The preferred shell

SORT (cf)
    The sort utility

STRIP_EXE (cf)
    The strip utility, or "true" if the OS does not have one

TAIL (cf)
    the tail utility

TEE (cf)
    The tee utility

TEST (cf)
    The test utility

TOUCH (cf)
    The touch utility

TR (cf)
    The tr utility

TRUE (cf)
    The true utility

TSORT (cf)
    The tsort utility

TYPE (cf)
    The type utility

WC (cf)
    The wc utility

XARGS (cf)
    The xargs utility



ESSENTIAL_PROGRAMS (r)
	This variable enumerates the variables that should go into
	ESSENTIAL_ENV. These are mostly variables with utility
	programs.

ESSENTIAL_ENV (r)
	The environment containing the utility programs enumerated
	in ESSENTIAL_PROGRAMS

======================================================================
General package description
======================================================================

These variables are per package.

PKGNAME (w)
    The name of the package and the version string, separated by "-".
    For example: godi-core-mk-3.5

    When setting this variable in "Makefile", the version string must
    not have a revision suffix like "godi4". However, bsd.pkg.mk
    appends this suffix, and sets PKGNAME_NOREV to the original,
    suffix-free name.

    If this variable is not set in a package "Makefile", DISTNAME will
    be used instead, and must be set to the package name plus version
    string.

PKGNAME_NOREV (r)
    The name of the package plus version string, but without revision
    suffix

PKGREVISION (w)
    The package revision, a decimal number. This number is appended
    to PKGNAME, separated by "godi", when the name of the .build.tgz
    file is constructed, e.g. godi-core-mk-3.5godi4.build.tgz.

    When the PKGREVISION is 0, no "godi" suffix is appended to the
    file, however. This is the same as not defining PKGREVISION at
    all. 

    The package revision should be increased when the build
    instructions are updated for the same version of the upstream
    software.

PKGBASE (r)
    The name of the package without version string, derived from
    PKGNAME.

PKGVERSION (r)
    The version string of the package only, derived from PKGNAME.
    Of course, this implies that there is no revision suffix, too.

DISTNAME (w)
    The "distibution name" as chosen by the upstream author. This
    should be set to the name of the directory that is created when
    the source tarball is extracted.

DISTFILES (w)
    The name(s) of the source tarball(s). By default, this is DISTNAME
    plus EXTRACT_SUFX (.tar.gz)

EXTRACT_SUFX (w)
    The tarball suffix, by default .tar.gz. The framework supports
    these suffixes: .tar.gz, .tgz, .tar.bz2, .tbz, .tar.Z, .tar,
    .shar.gz, .shar.bz2, .shar.Z, .shar, .Z, .bz2, .gz

    (Support for zip, lha, zoo has been removed!)

EXTRACT_ONLY (w)
    The name(s) of the source tarball(s) to extract. By default, the
    same as DISTFILES.

PATCHFILES (w)
    ?

CATEGORIES (w)
    A list of categories. Currently, GODI defines only "apps", "base",
    "conf", and "godi".

MAINTAINER (w)
    A description who maintains this package. Should contain name and
    email address

DESCR_SRC (w)
    The file containing the long package description. 
    Defaults to DESCR in the package directory.

PLIST_SRC (w)
    The file containing the pack list.
    Defaults to PLIST in the package directory. If GODI_PLIST is
    defined, it defaults to PLIST.godi instead.

    Format of the file: see plist-ref.txt

GODI_PLIST (w)
    Changes the default for PLIST_SRC.

    In early versions of godi-core-mk, this variable also triggered
    the interpretation of additional PLIST directives.

PLIST_SUBST (w)
    Contains a substitution for variables in PLIST. One can add
    further variables in the format NAME=VALUE, where VALUE should be
    shell-quoted.

MESSAGE_SRC (w)
    The file containing the message displayed when a binary package
    is added. Defaults to MESSAGE in the package directory if this
    file exists

MESSAGE_SUBST (w)
    Contains a substitution for variables in MESSAGE. One can add
    further variables in the format NAME=VALUE, where VALUE should be
    shell-quoted.

DEPENDS (w)
    Enumerates the strict dependencies on other packages, i.e. it
    enumerates other packages that must be present when this package
    is used.

    The format is a space-separated list of dependencies like:

    <PKGBASE><OPERATOR><VERSION>:../../<CAT>/<PKGDIR>

    Here, <PKGBASE> is the base name of the other package, without
    version string. <OPERATOR> is one of ==, !=, >=, >, <=, <.
    The <VERSION> is a version string without revision suffix.
    <CAT> and <PKGDIR> are chosen such that the part after ":"
    is the relative path to the package directory (note that this
    part is only interpreted by some legacy scripts, godi_console
    ignores it; however, it should be present for now).

    The exact algorithm comparing version strings is described
    elsewhere. The parts of hierarchical version strings must be
    separated by ".". The parts can be decimal numbers or alphanumeric
    strings. The keywords "pre", "test", "alpha", "beta", "rc", "pl" are 
    handled specially.

    Note that package revisions are ignored for the comparison.

    If the version does not matter, use

    <PKGBASE>-[0-9]*:../../<CAT>/<PKGDIR>

    or, maybe better,

    <PKGBASE>>=0:../../<CAT>/<PKGDIR>

    (with ">=").

BUILD_DEPENDS (w)
    Enumerates the build dependencies on other packages, i.e. it
    enumerates other packages that must be present when this package
    is built.

    The format is the same as for DEPENDS.

MASTER_SITES (w)
    URLs where to download the DISTFILES. The URLs must
    end with a slash.

PATCH_SITES (w)
    URLs where to download the PATCHFILES. The URLs must
    end with a slash.

SELF_UPDATE_PKG (pw)
    Used internally by GODI to signal that an alternate
    installation method must be used.

======================================================================
Variables controlling the build
======================================================================

These variables are per package.

HAS_CONFIGURE (w)
	If defined, the configure script must be called

GNU_CONFIGURE (w)
	If defined, the configure script must be called, and it can be
	assumed that it is a GNU autoconf-style script

CONFIGURE_ENV (w) 
	The environment to use for "configure". The format
	of this variable is a space-separated list of NAME=VALUE
	strings that can be parsed by the shell. By
	default, a lot of variables are already defined. To add
	variables, use this syntax:

	CONFIGURE_ENV += MYVAR=${MYVAR:Q}

	(The :Q modifier enables shell quoting.)

CONFIGURE_GETS_ESSENTIALS (w)
	If "yes", a number of additional variables are added to
	CONFIGURE_ENV, in particular these of ESSENTIAL_ENV.

CONFIGURE_SCRIPT (w)
	The name of the configure script to call. Defaults to
	"configure".

CONFIGURE_ARGS (w)
	Arguments passed to the configure script.

CONFIGURE_DIRS (w)
	Enumerates the directories where "configure" is to be invoked.
	By default, only the WRKSRC directory is taken.

USE_GMAKE (w)
	When defined, GNU make is used to build/install the package; otherwise
	BSD make is used

MAKE_PROGRAM (r)
	The selected version of the "make" utility

MAKE_ENV (w)
	The environment to use when "make" is called to build/install the
	package. The format of this variable is a space-separated list of
	NAME=VALUE strings that can be parsed by the shell. By
	default, a lot of variables are already defined. To add
	variables, use this syntax:

	MAKE_ENV += MYVAR=${MYVAR:Q}

	(The :Q modifier enables shell quoting.)

MAKE_GETS_ESSENTIALS (w)
	If "yes", a number of additional variables are added to
	MAKE_ENV, in particular these of ESSENTIAL_ENV.

MAKE_FLAGS (w)
	Arguments passed to "make" when it is called to build/install the
	package.

	Att: There is also MAKEFLAGS, but this has a different meaning.

MAKEFILE (w)
	The name of the makefile when "make" is called to build/install the
	package. Defaults to "Makefile".

ALL_TARGET (w)
	The "make" target to build the package. Defaults to "all"

BUILD_DIRS (w)
	Enumerates the directories where ALL_TARGET is invoked.
	By default WRKSRC.

TEST_TARGET (w)
	The "make" target to test the package. This is not defined
	by default, and no test is done. To enable tests, one must
	also set PKGSRC_RUN_TEST.

TEST_DIRS (w)
	Enumerates the directories where TEST_TARGET is invoked.
	By default WRKSRC.

INSTALL_TARGET (w)
	The "make" target to install the package. Defaults to
	"install"

INSTALL_DIRS (w)
	Enumerates the directories where INSTALL_TARGET is invoked.
	By default WRKSRC.

UNLIMIT_RESOURCES (w)
	When defined, resource restrictions are removed (ulimit)
	before a package is built

======================================================================
Variables controlling details of the build
======================================================================

--- traditional toolchain control ---

CC

CPP

CFLAGS

CPPFLAGS

LDFLAGS


======================================================================
Site patches
======================================================================

These patches are provided by the site using GODI, and are applied to
packages when they are built.

LOCALPATCHES (c)
	The variable must contain the base directory for site
	patches. The site patches for package cat-foo are then found
         in the directory $LOCALPATCHES/cat/cat-foo (here, cat is the
         package category like "apps", or "godi", and foo is a
         placeholder for the name). For example, the patches for
         godi-ocamlnet would be expected in $LOCALPATCHES/godi/godi-ocamlnet.
	The patches in this directory are handled as if they were in
	the "patches" directory of the build directory. The patch files
	should obey the name convention "patch-LL-SUFFIX" where
	LL are two letters specifying the order in which all packages
	are applied (i.e. in alphebetical order). SUFFIX is an
	arbitrary suffix, usually describing the patched file.
	Patches should be in unified form (produced with
	diff -Naur); file names must be relative to the
	source directory ($WRKSRC), i.e. create patches with

	cd $WRKSRC
	diff -Naur file ... >$LOCALPATCHES/cat/cat-foo/patch-LL-SUFFIX

	Pitfall: Don't leave files ending in ~ in this directory,
	they are also treated as patch.


======================================================================
Debugging
======================================================================

PKG_DEBUG_LEVEL (special)
	The value 0 means that no debugging output is generated.
	The value 1 means that shell commands are echoed before they
	are called.
	The value 2 means that the shell is even called with "-x"
	flag to echo even more commands.

	This variable should be set on the command line, e.g.
	godi_make build PKG_DEBUG_LEVEL=2

This web site is published by Informatikb√ľro Gerd Stolpmann
Powered by Caml