# Port Phases

## Introduction

The MacPorts port installation process has a number of distinct phases that are described in detail in this section. The default scripts coded into MacPorts base performs the standard `configure`, `make`, and `make install` steps. For applications that do not conform to this standard, installation phases may be declared in a Portfile to augment or override the default behavior as described in the Portfile Development chapter.

fetch

  Fetch the `${distfiles}` from `${master_sites}` and place it in `${prefix}/var/macports/distfiles/${name}`.

checksum

  Compare `${checksums}` specified in a `Portfile` to the checksums of the fetched ${distfiles}.

extract

  Unzip and untar the `${distfiles}` into the path ${prefix}/var/macports/build/..../work

patch

  Apply optional patch files specified in `${patchfiles}` to modify a port's source code file(s).

configure

  Execute the command `configure` in `${worksrcpath}`.

build

  Execute `${build.cmd}` in `${worksrcpath}`.

test

  Execute commands to run test suites bundled with a port.

destroot

  Execute the command `make install` `DESTDIR=${destroot}`in `${worksrcpath}`.

  Understanding the destroot phase is critical to understanding MacPorts, because, unlike some port systems, MacPorts "stages" an installation into an intermediate location —not the final file destination. MacPorts uses the destroot phase to provide:

  - Port uninstalls - a port's files may be cleanly uninstalled because all files and directories are recorded during install.

  - Multiple port versions may be installed on the same host, since a port's files are not directly inserted into `${prefix}` but rather hard-linked into `${prefix}` from an intermediate location during a later activation phase.

  The `DESTDIR` variable must be supported in an application's Makefile for the MacPorts destroot phase to work properly. Urge developers to fully support `DESTDIR` in their Makefiles.

  Any empty directories in `${destroot}` upon completion of the destroot phase are removed unless a directory name is placed in the value field of the optional `destroot.keepdirs` keyword.

archive

  Use tar to create a tarball of a port's destrooted files and copy it to `${prefix}/var/macports/packages/`.

install

  Copy a port's destrooted files into `${prefix}/var/macports/software`. See Port Images in the MacPorts Internals chapter for details.

activate

  Set hardlinks pointing to `${prefix}/var/macports/software` to point to `${prefix}`.

## Installation Phase Keywords

MacPorts keywords are used to specify required or optional items within a Portfile, or to override default options used by MacPorts base for individual ports. Keywords are to be used within the "global" and "variant" sections of Portfiles, and not within optional port phase declarations.

In other words, port phase keywords are not located within port phase declarations, but rather they refer to port phases and set options for those phases, and they take affect whether or not phase declarations have been explicitly defined in a Portfile.

### Keyword List Modifiers (-append / -delete)

Keyword list modifiers are keywords that end in -append or -delete. Keywords that support list modifiers are identified under appropriate reference sections below. Keyword list modifiers are most frequently used for these three purposes:

1. Preserve configure Defaults set by a previously executed Portfile keyword or by MacPorts base

   MacPorts base sets the gcc compiler flags CFLAGS and LDFLAGS for all ports using `configure.cflags` and `configure.ldflags`, therefore to keep from overwriting the default compiler flags use `configure.cflags-append` and `configure.ldflags-append`.

   - `configure.cflags-append`

   - `configure.ldflags-append`

2. Preserve PortGroup Dependencies

   Ports in a PortGroup have default library dependencies set by MacPorts base. Therefore, never use `depends_lib` in ports belonging to a PortGroup or it will overwrite the default library dependencies. Instead, use `depends_lib-append`.

3. Add or Delete Items for Variants

   When a variant requires more or fewer dependencies, distfiles, or patchfiles, when the variant is invoked you want to add or remove items to the appropriate keyword values list set in the global section of the Portfile. Use the appropriate keywords, for example:

   - `depends_lib-append` or `depends_lib-delete`

   - `distfiles-append` or `distfile-delete`

   - `patchfiles-append` or `patchfiles-delete`

### Keyword Argument Modifiers (.pre_args / .post_args)

Keywords that support pre_args and post_args are used to assemble command strings together in a row, as described in the reference sections below. But it should be noted that all keyword argument modifiers implicitly support keyword list modifiers. For example, the keyword `configure.pre_args` also supports `configure.pre_args-append` and `configure.pre_args-delete`.

## Fetch Phase Keywords

The list of keywords related to the fetch phase.

master_sites

  A list of URLs from which a port's `${distfiles}` may be retrieved.

  Keyword values for `master_sites` may include predefined site lists known as mirrors, such as sourceforge, gnu, etc. If the file(s) declared in `${distfiles}` are not successfully fetched after trying the `master_sites` values, the MacPorts Project mirror is always tried last before giving up.

  For a complete list of mirrors and their list of sites, see the file `mirror_sites.tcl` located in `${prefix}/share/macports/resources/port1.0/fetch/`.

  If a `master_sites` keyword has multiple values, after any mirrors are expanded the list of sites is sorted by ping response times. The sites are then tried in sorted order until matching `${distfiles}` are found.

  - Default: `macports` (the MacPorts Project mirror - implicit final value of `master_sites`)

  - Examples:

        master_sites        http://www.example.org/files/ \
                            http://www.examplemirror.org/example_org/files/

    You may also use mirror site lists predefined by MacPorts. Here the sourceforge, gnu, and MacPorts Project mirrors are used.

        master_sites        sourceforge gnu macports

    Though the MacPorts Project mirror (`macports`) is always tried last if no `${distfiles}` match is found, if the mirror `macports` is explicitly declared it is tried in the normal sort order.

    When using mirror master_sites, the subdirectory `${name}` is checked on every mirror. If the mirror subdirectory does not match ${name}, then you may specify it using after the mirror separated by a colon.

        master_sites        sourceforge:widget \
                            gnu:widget

    For ports that must fetch multiple download files from different locations, you must label the files with tags and match the tags to a `distfiles` keyword. The format is `mirror:subdirectory:tag`.

    In the example below, file_one.tar.gz is fetched from sourceforge mirrors in subdirectory `${name}`; file tagtwo.tar.gz is fetched from the gnu mirrors in subdirectory sources.

        master_sites        sourceforge::tagone \
                            gnu:sources:tagtwo

        distfiles           file_one.tar.gz:tagone \
                            file_two.tar.gz:tagtwo

master_sites.mirror_subdir

  Subdirectory to append to all mirror sites for any list specified in `${master_sites}`.

  - Default: `${name}`

  - Example:

        master_sites.mirror_subdir  magic

patch_sites

  A list of sites from which a port's patchfiles may be downloaded, where applicable.

  - Default: `${master_sites}`

  - Example:

        patch_sites         ftp://ftp.patchcityrepo.com/pub/magic/patches

patch_sites.mirror_subdir

  Subdirectory to append to all mirror sites for any list specified in `${patch_sites}`.

  - Default: `${name}`

  - Example:

        patch_sites.mirror_subdir   magic

distname

  The name of the distribution filename, not including the extract suffix (see below).

  - Default: `${name}-${version}`

  - Example:

        distname            ${name}

distfiles

  The full distribution filename, including the extract suffix. Used to specify non-default distribution filenames; this keyword must be specified (and tags used) when a port has multiple download files (see master_sites).

  - Default: `${distname}${extract.suffix}`

  - Examples:

        distfiles           ${name}-dev_src.tgz

        distfiles           file_one.tar.gz:tagone \
                            file_two.tar.gz:tagtwo

dist_subdir

  Create a sub-directory in distpath to store all fetched files.

  - Default: `${name}`

  - Example:

        dist_subdir         vim${version}

worksrcdir

  Sets the path to source directory relative to workpath. It can be used if the extracted source directory has a different name then the distfile.

  - Default: `${distname}`

  - Example:

        worksrcdir          ${name}-src-${version}

### Advanced Fetch Options

Some mirrors require special options for a resource to be properly fetched.

fetch.type

  Change the fetch type. This is only necessary if a CVS, svn, git or hg checkout is be used. `standard` is used for a normal http or ftp fetch using `${distfiles}` and is used as default.

  - Default: `standard`

  - Values: `standard` `cvs` `svn` `git`

  - Example:

        fetch.type          svn
        svn.url             svn://example.org
        svn.tag             2100

fetch.user

  HTTP or FTP user to fetch the resource.

  - Default: none

  - Example:

        TODO: add example

fetch.password

  HTTP or FTP password to fetch the resource.

  - Default: none

  - Example:

        TODO: add example

fetch.use_epsv

  Whether to use EPSV command for FTP transfers.

  - Default: `yes`

  - Example:

        fetch.use_epsv      no

fetch.ignore_sslcert

  Whether to ignore the host SSL certificate (for HTTPS).

  - Default: `no`

  - Example:

        fetch.ignore_sslcert    yes

### Fetch from CVS

CVS may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via CVS may cause non-reproducible builds, so it is strongly discouraged.

The `cvs` fetch.type is used to fetch source code from a CVS repository.

cvs.root

  Specify the url from which to fetch files.

  - Default: none

  - Example:

        cvs.root            :pserver:anonymous@cvs.sv.gnu.org:/sources/emacs

cvs.password

  Password to login to the CVS server.

  - Default: none

  - Example:

        TODO: add example

cvs.tag

  Optional for fetching with CVS, this specifies the code revision to checkout.

  - Default: none

  - Example:

        cvs.tag             HEAD

cvs.date

  A date that identifies the CVS code set to checkout.

  - Default: none

  - Example:

        cvs.date            "12-April-2007"

cvs.module

  A CVS module from which to check out the code.

  - Default: none

  - Example:

        cvs.module          Sources

### Fetch from Subversion

Subversion may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via Subversion may cause non-reproducible builds, so it is strongly discouraged.

The `svn` fetch.type is used to fetch source code from an svn repository.

svn.url

  This specifies the url from which to fetch files.

  - Default: none

  - Examples:

        svn.url             http://www.domain.com/svn-repo/mydirectory

        svn.url             svn://www.domain.com/svn-repo/mydirectory

svn.tag

  Optional tag for fetching with Subversion, this specifies the code revision to checkout; it corresponds to the -r option in the svn cli.

  - Default: none

  - Example:

        svn.tag             37192

### Fetch from Git

Git may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via Git may cause non-reproducible builds, so it is strongly discouraged.

The `git` fetch.type is used to fetch source code from a git repository.

git.url

  This specifies the url from which to fetch files.

  - Default: none

  - Examples:

        git.url             git://git.kernel.org/pub/scm/git/git.git

        git.url             http://www.kernel.org/pub/scm/git/git.git

git.branch

  Optional tag for fetching with git, this specifies a branch (or other commit-ish) that git should checkout. Note that any branch besides HEAD should be prefixed by origin/.

  - Default: none

  - Example:

        git.branch             72bf1c8

        git.branch             origin/next

### Fetch from Mercurial

Mercurial may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via Mercurial may cause non-reproducible builds, so it is strongly discouraged.

The `hg` fetch.type is used to fetch fource code from a Mercurial repository.

hg.url

  This specifies the url from which to fetch files.

  - Default: none

  - Examples:

        hg.url              http://www.kernel.org/hg/index.cgi/linux-2.6/

        hg.url              http://hg.intevation.org/mercurial

hg.tag

  Optional tag which should be fetched. Can be a Mercurial tag or a revision. To prevent non-reproducible builds use of tip as revision is discouraged.

  - Default: tip

  - Example:

        hg.tag                 v1.3

        hg.tag                 ceb884843737

## Checksum Phase Keywords

The list of keywords related to the checksum phase.

checksums

  Checksum(s) of the distribution files. For ports with multiple distribution files, filenames must be included to associate files with their checksums.

  All checksum types (md5, sha1 and rmd160) should be used to ensure the integrity of the distfiles.

  - Default: ???

  - Examples:

        checksums           md5 dafa161bc9c61e57636a6085c87c1fe8 \
                            sha1 5da610e1c8bc01b80abc21ab9e98e004363b429c \
                            rmd160 0c1147242adf476f5e93f4d59b553ee3ea378b23

        checksums           ${distname}${extract.suffix} \
                                md5 dafa161bc9c61e57636a6085c87c1fe8 \
                                sha1 5da610e1c8bc01b80abc21ab9e98e004363b429c \
                                rmd160 0c1147242adf476f5e93f4d59b553ee3ea378b23 \
                            hobbit.tar.gz \
                                md5 3b8d02c6cf6239b9bdadbc6543c5a683 \
                                sha1 27874638b23e66d39ed94fe716ca25c967f6e993 \
                                rmd160 82b9991f3bf0ceedbf74c188c5fa44b98b5e40c9

## Extract Phase Keywords

The list of keywords related to the extract phase.

extract.suffix

  This keyword is used to specify the extract suffix type.

  - Default: `.tar.gz`

  - Example:

        extract.suffix      .tgz

use_bzip2

  This keyword is for downloads that are tarred and bzipped. When invoked, it automatically sets:

      extract.suffix = .tar.bz
      extract.cmd    = bzip

  - Default: `no`

  - Example:

        use_bzip2           yes

use_lzma

  This keyword is for downloads that are compressed using the lzma algorithm. When invoked, it automatically sets:

      extract.suffix    = .lzma
      extract.cmd       = lzma

  - Default: `no`

  - Example:

        use_lzma             yes

use_zip

  This keyword is for downloads that are zipped. When invoked, it automatically sets:

      extract.suffix    = .zip
      extract.cmd       = unzip
      extract.pre_args  = -q
      extract.post_args = "-d ${portpath}/${workdir}"

  - Default: `no`

  - Example:

        use_zip             yes

extract.mkdir

  This keyword is used to specify if the directory `worksrcdir` is part of the distfile or if it should be created automatically and the distfiles should be extracted there instead. This is useful for distfiles with a flat structure which would pollute the `worksrcdir` with lots of files.

  - Default: `no`

  - Example:

        extract.mkdir       yes

extract.only
extract.only-append
extract.only-delete

  List of files to extract into `${worksrcpath}`. Only use if default extract behavior is not correct for your port.

  - Default: `${distfiles}`

  - Example:

        extract.only        foo.tar.gz

        extract.only-append     bar.tar.gz
        extract.only-delete     foo.tar.gz

extract.cmd

  Command to perform extraction.

  - Default: `gzip`

  - Example:

        extract.cmd         gunzip

extract.args
extract.pre_args
extract.post_args

  Main arguments to `extract.cmd`; additional arguments passed before and after the main arguments.

  - Default: `${distpath}/${distfile}`

  - Example:

        extract.args        ${distpath}/${distfile}

  The following argument modifiers are available:

  - `extract.pre_args`, defaults to: `-dc`

  - `extract.post_args`, defaults to: `"| tar -xf"`

  - Examples:

        extract.pre_args    xf
        extract.post_args   "| gnutar -x"

## Patch Phase Keywords

The list of keywords related to the patch phase.

patch.dir

  Specify the base path for patch files.

  - Default: `${worksrcpath}`

  - Example:

        patch.dir           ${worksrcpath}/util

patch.cmd

  Specify the command to be used for patching files.

  - Default: `patch`

  - Example:

        patch.cmd           cat

patchfiles
patchfiles-append
patchfiles-delete

  Specify patch files to be applied for a port; list modifiers specify patchfiles to be added or removed from a previous patchfile declaration.

  - Default: none

  - Example:

        patchfiles          patch-Makefile.in \
                            patch-source.c

        patchfiles-append   patch-configure
        patchfiles-delete   patch-src-Makefile.in

patch.args
patch.pre_args
patch.post_args

  Main arguments to `patch.cmd`; optional argument modifiers pass arguments before and after the main arguments.

  - Default: none

  - Example:

        patch.args          ???

  The following argument modifiers are available:

  - `patch.pre_args`, defaults to: `-p0`

  - `patch.post_args`, defaults to: none

  - Examples:

        patch.pre_args      -p1
        patch.post_args     ???

## Configure Phase Keywords

The list of keywords related to the configure phase.

MacPorts base sets some important default configure options, so should use the -append version of most configure keywords so you don't overwrite them. For example, MacPorts base sets default `configure.cflags` so you should always use `configure.cflags-append` to set additional CFLAGS in Portfiles.

use_configure

  Sets if the configure phase should be run. Can be used if the port has no `./configure` script.

  - Default: `yes`

  - Example:

        use_configure    no

configure.env
configure.env-append
configure.env-delete

  Set environment variables for configure; list modifiers add and delete items from a previous Portfile configure.env keyword, or a default set by MacPorts base. If available, it is encouraged to use the predefined options (like configure.cflags) instead of modifying configure.env directly.

  - Default: `CFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib`

  - Example:

        configure.env       QTDIR=${prefix}/lib/qt3

        configure.env-append    ABI=32
        configure.env-delete    TCLROOT=${prefix}

configure.cflags
configure.cflags-append
configure.cflags-delete

  Set CFLAGS compiler flags; list modifiers add or delete items from a previous Portfile configure.cflags keyword or the default set by MacPorts base.

  - Default: `-O2`

  - Example:

        configure.cflags    -Os -flat_namespace

        configure.cflags-append     "-undefined suppress"
        configure.cflags-delete     -O2

configure.ldflags
configure.ldflags-append
configure.ldflags-delete

  Set LDFLAGS compiler flags; list modifiers add or delete items from a previous Portfile configure.ldflags keyword or the default set by MacPorts base.

  - Default: `-L${prefix}/lib`

  - Example:

        configure.ldflags   "-L${worksrcpath}/zlib -lz"

        configure.ldflags-append    "-L/usr/X11R6/lib -L${worksrcpath}/lib"
        configure.ldflags-delete    -L${prefix}/lib/db44

configure.cppflags
configure.cppflags-append
configure.cppflags-delete

  Set CPPFLAGS to be passed to the C processor; list modifiers add or delete items from a previous Portfile configure.cppflags keyword or the default set by MacPorts base.

  - Default: `-I${prefix}/include`

  - Example:

        configure.cppflags  -I${worksrcpath}/include

        configure.cppflags-append   "-I/usr/X11R6/lib -I${worksrcpath}/lib -DHAVE_RRD_12X"
        configure.cppflags-delete   -I${prefix}/lib/db44

configure.cxxflags
configure.cxxflags-append
configure.cxxflags-delete

  Set CXXFLAGS to be passed to the C++ processor; list modifiers add or delete items from a previous Portfile configure.cxxflags keyword or the default set by MacPorts base.

  - Default: `-O2`

  - Example:

        TODO: add example

configure.objcflags
configure.objcflags-append
configure.objcflags-delete

  TODO: add description

  - Default: `-O2`

  - Example:

        TODO: add example

configure.classpath
configure.classpath-append
configure.classpath-delete

  TODO: add description

  - Default: ???

  - Example:

        TODO: add example

configure.macosx_deployment_target
configure.macosx_deployment_target-append
configure.macosx_deployment_target-delete

  TODO: add description

  - Default: ???

  - Example:

        TODO: add example

configure.fflags
configure.fflags-append
configure.fflags-delete

  Set FFLAGS to be passed to the Fortran compiler; list modifiers add or delete items from a previous Portfile configure.fflags keyword or the default set by MacPorts base.

  - Default: `-O2`

  - Example:

        configure.fflags    -Os

configure.fcflags
configure.fcflags-append
configure.fcflags-delete

  Set FCFLAGS to be passed to the Fortran compiler; list modifiers add or delete items from a previous Portfile configure.fcflags keyword or the default set by MacPorts base.

  - Default: `-O2`

  - Example:

        configure.fcflags   -Os

configure.f90flags
configure.f90flags-append
configure.f90flags-delete

  Set F90FLAGS to be passed to the Fortran 90 compiler; list modifiers add or delete items from a previous Portfile configure.f90flags keyword or the default set by MacPorts base.

  - Default: `-O2`

  - Example:

        configure.f90flags  -Os

configure.cc

  Set CC compiler flags for selecting a C compiler.

  - Default: `???`

  - Example:

        configure.cc        ${prefix}/bin/gcc-mp-4.2

configure.cpp

  Set CPP compiler flags for selecting a C preprocessor.

  - Default: `???`

  - Example:

        configure.cpp       /usr/bin/cpp-3.3

configure.cxx

  Set CXX compiler flags for selecting a C++ compiler.

  - Default: `???`

  - Example:

        configure.cxx       /usr/bin/g++-4.0

configure.objc

  Set OBJC compiler flags for selecting an Objective-C compiler.

  - Default: `???`

  - Example:

        configure.objc      /usr/bin/gcc-4.0

configure.fc

  Set FC compiler flags for selecting a Fortran compiler.

  - Default: `???`

  - Example:

        configure.fc        ${prefix}/bin/gfortran-mp-4.2

configure.f77

  Set F77 compiler flags for selecting a Fortran 77 compiler.

  - Default: `???`

  - Example:

        configure.f77       ${prefix}/bin/gfortran-mp-4.2

configure.f90

  Set F90 compiler flags for selecting a Fortran 90 compiler.

  - Default: `???`

  - Example:

        configure.f90       ${prefix}/bin/gfortran-mp-4.2

configure.javac

  Set JAVAC compiler flags for selecting a Java compiler.

  - Default: `???`

  - Example:

        configure.javac     ${prefix}/bin/jikes

configure.compiler

  Select a compiler suite to fill the compiler environment variables. All variables/tools a compiler suite can provide are set. Manually set variables are not overwritten. Dependencies are not added for you, as they may be just build- or also run-dependencies. Keep in mind that not all compiler suites might be available on your platform: `gcc-3.3` is available on Mac OS X 10.3 and 10.4 PowerPC, `gcc-4.0` is available on 10.4 and 10.5, `gcc-4.2` is available as preview for 10.5.

  Only use it if a port really needs a different compiler.

  - Default: `gcc-3.3` on Mac OS X 10.3

  - Default: `gcc-4.0` on Mac OS X 10.4 and 10.5

  - Values: `gcc-3.3` `gcc-4.0` `gcc-4.2` `llvm-gcc-4.2` `apple-gcc-3.3` `apple-gcc-4.0` `macports-gcc-3.3` `macports-gcc-3.4` `macports-gcc-4.0` `macports-gcc-4.1` `macports-gcc-4.2` `macports-gcc-4.3` `macports-gcc-4.4`

  - Example:

        configure.compiler  macports-gcc-4.2

configure.perl

  Set PERL flag for selecting a Perl interpreter.

  - Default: `???`

  - Example:

        configure.perl      ${prefix}/bin/perl5.8

configure.python

  Set PYTHON flag for selecting a Python interpreter.

  - Default: `???`

  - Example:

        configure.python    ${prefix}/bin/python3.0

configure.ruby

  Set RUBY flag for selecting a Ruby interpreter.

  - Default: `???`

  - Example:

        configure.ruby      ${prefix}/bin/ruby

configure.install

  Set `INSTALL` flag for selecting an install tool; used for copying files and creating directories.

  - Default: `/usr/bin/install`

  - Example:

        configure.install   ${prefix}/bin/ginstall

configure.awk

  Set AWK flag for selecting an awk executable.

  - Default: `???`

  - Example:

        configure.awk       ${prefix}/bin/gawk

configure.bison

  Set BISON flag for selecting a bison executable, a parser generator.

  - Default: `???`

  - Example:

        configure.bison     /usr/bin/bison

configure.pkg_config

  Set PKG_CONFIG flag for helping find pkg_config, a tool for retrieving information about installed libraries.

  - Default: `???`

  - Example:

        configure.pkg_config    ${prefix}/bin/pkg-config

configure.pkg_config_path

  Set PKG_CONFIG_PATH flag for telling pkg_config where to search for information about installed libraries.

  - Default: `???`

  - Example:

        configure.pkg_config_path   ${prefix}/lib/pkgconfig:${x11prefix}/lib/pkgconfig

configure.args
configure.pre_args
configure.post_args

  Main arguments to `configure.cmd`; optional argument modifiers pass arguments before and after the main arguments.

  - Default: none

  - Example:

        configure.args      --bindir=${prefix}/bin

  The following argument modifiers are available:

  - `configure.pre_args`, defaults to: `--prefix=${prefix}`

  - `configure.post_args`, defaults to: none

  - Examples:

        configure.pre_args  --prefix=${prefix}/share/bro
        configure.post_args OPT="-D__DARWIN_UNIX03"

### Configure Universal

Universal keywords are used to make a port compile on the Mac OS X platform to run on both PPC and Intel processors.

There is a default universal variant made available to all ports by MacPorts base, so redefining universal keywords should only be done to make a given port compile if the default options fail to do so.

configure.universal_args

  Arguments used in the configure script to build the port universal.

  - Default: `--disable-dependency-tracking`

  - Example:

        TODO: add example

configure.universal_cflags

  Arguments appended to the configure script to build the port universal.

  - Default: `-sysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc`

  - Example:

        TODO: add example

configure.universal_cppflags

  Additional flags to put in the CPPFLAGS environment variable when invoking the configure script.

  - Default: `???`

  - Example:

        TODO: add example

configure.universal_cxxflags

  Additional flags to put in the CXXFLAGS environment variable when invoking the configure script.

  - Default: `-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc`

  - Example:

        TODO: add example

configure.universal_ldflags

  Additional flags to put in the LDFLAGS environment variable when invoking the configure script.

  - Default: `-arch i386 -arch ppc`

  - Example:

        TODO: add example

### Automake and Autoconf

The list of configure keywords available for ports that need automake and/or autoconf.

use_automake

  Whether or not to use automake.

  - Default: `no`

  - Example:

        use_automake        yes

automake.env

  Environment variables to pass to automake.

  - Default: ???

  - Example:

        automake.env        CFLAGS=-I${prefix}/include

automake.args

  Arguments to pass to automake.

  - Default: ???

  - Example:

        automake.args       --foreign

automake.dir

  Directory in which to run `${automake.cmd}`.

  - Default: `${worksrcpath}`

  - Example:

        automake.dir        ./src

use_autoconf

  Whether or not to use autoconf.

  - Default: `no`

  - Example:

        use_autoconf        yes

autoconf.env

  Environmental variables to pass to autoconf.

  - Default: ???

  - Example:

        autoconf.env        CFLAGS=-I${prefix}/include/gtk12

autoconf.args

  Arguments to pass to autoconf.

  - Default: ???

  - Example:

        autoconf.args       "-l src/aclocaldir"

autoconf.dir

  Directory in which to run `${autoconf.cmd}`.

  - Default: `${worksrcpath}`

  - Example:

        autoconf.dir        src

## Build Phase Keywords

The list of keywords related to the build phase.

build.cmd

  Make command to run in `${worksrcdir}`. Only use it if you can't use `build.type`.

  - Default: `make`

  - Example:

        build.cmd           pbxbuild

build.type

  Defines which "make" is required. Sets `${build.cmd}` to either "gnumake" or "bsdmake" accordingly.

  - Default: `gnu`

  - Values: `gnu` `bsd`

  - Example:

        build.type          bsd

build.args
build.pre_args
build.post_args

  Main arguments to `${build.cmd}`; optional argument modifiers pass arguments before and after the main arguments.

  - Default: none

  - Example:

        build.args          -DNOWARN

  The following argument modifiers are available:

  - `build.pre_args`, defaults to: `${build.target.current}`

  - `build.post_args`, defaults to: none

  - Examples:

        build.pre_args      -project AudioSlicer.xcode
        build.post_args     CFLAGS_SYS="-DUSE_FREETYPE -DPREFER_FREETYPE"

build.target
build.target-append
build.target-delete

  Build target to pass to `${build.cmd}`; list modifiers add or delete items from a previous Portfile build.target keyword or the default set by MacPorts base.

  - Default: `all`

  - Example:

        build.target        all-src

        build.target-append     doc extra
        build.target-delete     compat

use_parallel_build

  This keyword is for specifying whether or not it is safe for a port to use multiple CPUs or multiple cores in parallel during its build phase. If `use_parallel_build` is set to yes in a given port, the option `-jN` is passed to `${build.cmd}` (if `${build.cmd}` is `make` or `scons`) where `N` represents the number of parallel build threads defined by the variable `buildmakejobs` in `macports.conf`. The default value of `buildmakejobs` is set to 1, therefore unless this variable is increased for a given MacPorts installation, parallel builds will not occur in any case.

  - Default: `no`

  - Example:

        use_parallel_build  yes

## Test Phase Keywords

The list of keywords related to the test phase.

test.run

  Enable running test suites bundled with a port.

  - Default: `no`

  - Example:

        test.run            yes

test.cmd

  Test command to run relative to `${worksrcdir}`.

  - Default: `${build.cmd}`

  - Example:

        test.cmd            checks.sh

test.target

  Test target to pass to `${test.cmd}`.

  - Default: `test`

  - Example:

        test.target         checks

## Destroot Phase Keywords

The list of keywords related to the destroot phase.

destroot.cmd

  Install command to run relative to `${worksrcdir}`. Only use it if you can't use `destroot.type`.

  - Default: `${build.cmd}`

  - Example:

        destroot.cmd        pbxbuild

destroot.type

  Defines which "make" is required. Sets `${destroot.cmd}` to either "gnumake" or "bsdmake" accordingly.

  - Default: `${build.type}`

  - Values: `gnu` `bsd`

  - Example:

        destroot.type       bsd

destroot.args
destroot.pre_args
destroot.post_args

  Main arguments to `${destroot.cmd}`; optional argument modifiers pass arguments before and after the main arguments.

  - Default: none

  - Example:

        destroot.args       BINDIR=${prefix}/bin

  The following argument modifiers are available:

  - `destroot.pre_args`, defaults to: `${destroot.target}`

  - `destroot.post_args`, defaults to: none

  - Examples:

        destroot.pre_args   -project AudioSlicer.xcode
        destroot.post_args  INSTDIR=${destroot}${prefix}

destroot.target
destroot.target-append
destroot.target-delete

  Install target to pass to `${destroot.cmd}`; list modifiers add or delete items from a previous Portfile destroot.target keyword or the default set by MacPorts base.

  - Default: `install`

  - Example:

        destroot.target     install install-config install-commandmode

        destroot.target-append  install-plugins
        destroot.target-delete  install-commandmode

destroot.destdir

  Arguments passed to `${destroot.cmd}` to install correctly into the destroot.

  - Default: `DESTDIR=${destroot}`

  - Example:

        destroot.destdir    prefix=${destroot}${prefix}

  If an application's Makefile properly supports the DESTDIR variable, MacPorts will automatically destroot the port properly. A port must destroot properly or the port will not install correctly, upgrade, or uninstall. If not, you may need to set this variable, or even patch the application's Makefile.

destroot.umask

  Umask to use during destroot.

  - Default: `022`

  - Example:

        destroot.umask      002

destroot.keepdirs

  A list of directories that should not be removed if empty upon destroot completion.

  - Default: ???

  - Example:

        destroot.keepdirs   ${destroot}${prefix}/var/run \
                            ${destroot}${prefix}/var/log \
                            ${destroot}${prefix}/var/cache/mrtg

destroot.violate_mtree

  MacPorts tests for compliance to the common directory structure in `${prefix}`. If a port is not compliant with the standard, set it to `yes`.

  You can find the macports standard in MacPorts File Hierarchy or in the porthier(7) man page.

  If `destroot.violate_mtree` is set to `yes`, the following warning is issued during the installation.

      Warning: portname requests to install files outside the common directory structure!

  This means that the port installed files outside of their normal locations in `${prefix}`. These could be files totally outside of `${prefix}`, which could cause problems on your computer, or files inside of `${prefix}` that are not in a standard location. Use `port contents portname` to see which files were installed.

  - Default: `no`

  - Example:

        destroot.violate_mtree      yes