# Configuration Files

The MacPorts configuration files do not need to be modified for the general end user. They contain options that may be of use to advanced users and port developers.

There are three MacPorts configuration files that define important variables used by the MacPorts system: `macports.conf`, `sources.conf`, and `variants.conf`. All MacPorts configurations files are located in `${prefix}/etc/macports`.

MacPorts configuration file format is a simple key/value pair separated by either a space or a tab. Lines beginning with '#' are comments, empty lines are ignored.

## macports.conf

macports.conf is the configuration file used to bootstrap the MacPorts system. This file is read by the port command and determines how it behaves.

Options locating other .conf files.

sources_conf

  Where to find the sources list.

  Default: `${prefix}/etc/macports/sources.conf`

variants_conf

  Where to find global variants definition file (optional).

  Default: `${prefix}/etc/macports/variants.conf`

Options for MacPorts general operating characteristics.

prefix

  Sets the directory where ports are installed. Any path may be used but those with spaces and/or non ascii characters should be avoided because it can break some ports. This key is often referred to as '${prefix}'.

  Default: `/opt/local`

x11prefix

  Path containing an X11 installation on your system.

  Default: `/usr/X11R6`

portdbpath

  Directory where MacPorts keeps working data as downloaded sources, installed port receipts, and the main registry. Same path restrictions apply as for '${prefix}'.

  Default: ${prefix}/var/macports

portdbformat

  Storage type to use for the MacPorts registry: flat or sqlite. sqlite is not yet supported.

  Default: `flat`

portinstalltype

  Sets the mode in which ports are installed by MacPorts. Supported values are "direct" or "image". In "direct" mode ports are installed directly into "${prefix}" and only one version of a port can be installed at any given time. In "image" mode multiple versions (and any possible combination of its variants) can be installed concurrently into "${portdbpath}/software/${portname}" and only one can be "activated" (hardlinked) into "${prefix}".

  Default: `image`

applications_dir

  Directory to install MacPorts that install Mac OS X .app bundles.

  Default: `/Applications/MacPorts`

frameworks_dir

  Directory to install frameworks installed by ports.

  Default: `${prefix}/Library/Frameworks`

portarchivemode

  Create and use binary archive packages for installation/reinstallation ease.

  Default: `no`

portarchivepath

  Where to store/retrieve port binary archive files.

  Default: `${prefix}/var/macports/packages`

portarchivetype

  Type of binary archive packages to create when using archive mode. Available types are: tgz, tar, tbz, tbz2, tlz, xar, zip, cpgz, cpio.

  Multiple types are supported to build multiple file types in one step. Unarchive uses multiple types as a search list to locate an archive, and the first to match a specified type is used. Multiple types must be separated by a colon or comma (NO spaces).

  Default: `.tgz`

configureccache

  Use ccache (C/C++ compiler cache) - see http://ccache.samba.org/

  Default: `no`

configuredistcc

  Use distcc (distributed compiler) - see http://distcc.samba.org/

  Default: `no`

configurepipe

  Use pipes rather than intermediate files when compiling C/C++/etc

  Default: `no`

buildnicevalue

  Lowered scheduling priority (0-20) to use for make when building ports.

  Default: 0

buildmakejobs

  Number of simultaneous make jobs (commands) to use when building ports. Using "0" will cause a runtime autodetection to use all available processer cores.

  Default: 1

portautoclean

  Set whether to automatically execute "clean" after "install" of ports.

  Default: `yes`

rsync_server

  Rsync server from which to fetch MacPorts sources.

  Default: rsync.macports.org

rsync_dir

  Rsync directory from which to pull the base/ component (infrastructure) of MacPorts.

  Default: `release/base/`

rsync_options

  Rsync options

  Default: -rtzv --delete-after

destroot_umask

  Umask value to use during the destrooting or a port.

  Default: 022

binpath

  Sets the directory search path for locating system executables (rsync, tar, etc.) during port installation. Only applications in these directories are available while ports are being installed even if other paths are specified by $PATH in a user's environment.

  Default: ${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:${x11prefix}/bin

  The binpath is implicitly defined, but it may be overwritten by defining the variable in macports.conf. However, using a non-default binpath is discouraged and should only be performed by advanced users.

Options for MacPorts Universal Binaries (+universal variant)

universal_target

  Sets MACOSX_DEPLOYMENT_TARGET

  Example: 10.5

universal_sysroot

  The SDK "sysroot" full path to use for +universal variant.

  Example: `/Developer/SDKs/MacOSX10.5.sdk`

universal_archs

  The machine architectures to use for +universal variant (multiple entries must be space delimited). Options include: ppc, i386, ppc64, x86_64

  Default: `ppc` `i386`

Options for StartupItems

startupitem_type

  Options for generated startup items, though this may be overridden by the "startupitem.type" Portfile key. Options are "default" option, "SystemStarter", "launchd", or "none". For an empty or "default" option, a startupitem type appropriate to the platform is used; if "none", no port startupitems are installed.

  Default: `default`

Other options

extra_env

  Extra environment variables to keep. Any variables listed here are added to the list of variables that are not removed from the environment used while processing ports.

  Default: none

## sources.conf

This file enables rsync synchronization of the default ports tree with the MacPorts rsync server when either of the commands `port selfupdate` or `port sync` are run.

Default: `rsync://rsync.macports.org/release/ports/`

Optional local repositories are enabled using a file url: file:///path/to/localportsrepository

## variants.conf

This optional file specifies any variants you'd like to be invoked globally. If a variant specified ib this file is not supported by a given Portfile, the variant is simply ignored.

Default: none