pkg-config.1 revision 10139
10139N/A<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
10139N/A<!--ArborText, Inc., 1988-1999, v.4002-->
10139N/A<!ENTITY cmd "pkg-config">
10139N/A<!ENTITY % commonents SYSTEM "smancommon.ent">
10139N/A%commonents;
10139N/A<!ENTITY % booktitles SYSTEM "booktitles.ent">
10139N/A%booktitles;
10139N/A<!ENTITY suncopy "Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.">
10139N/A]>
10139N/A<?Pub UDT _bookmark _target>
10139N/A<?Pub EntList brvbar bull cross dash diam diams frac12 frac13 frac14 hellip
10139N/A laquo lArr loz mdash nabla ndash para pound rArr raquo sect yen bsol>
10139N/A<?Pub Inc>
10139N/A<refentry id="pkg-config-1">
10139N/A<!-- %Z%%M% %I% %E% SMI; -->
10139N/A<refmeta><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum>
10139N/A<refmiscinfo class="date">15 Jul 2004</refmiscinfo>
10139N/A<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
10139N/A<refmiscinfo class="software">&release;</refmiscinfo>
10139N/A<refmiscinfo class="arch">generic</refmiscinfo>
10139N/A<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
10139N/A</refmeta>
10139N/A<indexterm><primary>pkg-config</primary></indexterm><indexterm><primary>return
10139N/Ameta information about installed libraries</primary></indexterm>
10139N/A<refnamediv id="pkg-config-1-name"><refname>pkg-config</refname><refpurpose>
10139N/Areturn meta information about installed libraries</refpurpose></refnamediv>
10139N/A<refsynopsisdiv id="pkg-config-1-synp"><title>&synp-tt;</title>
10139N/A<cmdsynopsis><command>&cmd;</command>
10139N/A<arg choice="opt"><option>-atleast-pkgconfig-version=<replaceable>version</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-atleast-version=<replaceable>version</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-cflags</option></arg>
10139N/A<arg choice="opt"><option>-cflags-only-I</option></arg>
10139N/A<arg choice="opt"><option>-cflags-only-other</option></arg>
10139N/A<arg choice="opt"><option>-define-variable=<replaceable>variablename=value</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-debug</option></arg>
10139N/A<arg choice="opt"><option>-errors-to-stdout</option></arg>
10139N/A<arg choice="opt"><option>-exact-version=<replaceable>version</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-exists</option></arg>
10139N/A<arg choice="opt"><option>-help</option></arg>
10139N/A<arg choice="opt"><option>-libs</option></arg>
10139N/A<arg choice="opt"><option>-libs-only-L</option></arg>
10139N/A<arg choice="opt"><option>-libs-only-l</option></arg>
10139N/A<arg choice="opt"><option>-libs-only-other</option></arg>
10139N/A<arg choice="opt"><option>-list-all</option></arg>
10139N/A<arg choice="opt"><option>-max-version=<replaceable>version</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-modversion</option></arg>
10139N/A<arg choice="opt"><option>-print-errors</option></arg>
10139N/A<arg choice="opt"><option>-silence-errors</option></arg>
10139N/A<arg choice="opt"><option>-short-errors</option></arg>
10139N/A<arg choice="opt"><option>-uninstalled</option></arg>
10139N/A<arg choice="opt"><option>-usage</option></arg>
10139N/A<arg choice="opt"><option>-variable=<replaceable>variablename</replaceable></option></arg>
10139N/A<arg choice="opt"><replaceable>libraries</replaceable></arg>
10139N/A</cmdsynopsis></refsynopsisdiv>
10139N/A<refsect1 id="pkg-config-1-desc"><title>&desc-tt;</title>
10139N/A<para><command>&cmd;</command> retrieves information about installed libraries
10139N/Ain the system. <command>&cmd;</command> is typically used to compile and link
10139N/Aagainst one or more libraries. The following example shows how to use <command>&cmd;</command>
10139N/Ain a Makefile: </para>
10139N/A<literallayout>program: program.c
10139N/A cc program.c `&cmd; --cflags --libs gtk+-2.0`</literallayout>
10139N/A<para><command>&cmd;</command> retrieves information about packages from special
10139N/Ametadata files. These files have the same name as the package, with the extension <filename>
10139N/A.pc</filename>. By default, <command>&cmd;</command> looks in the directory <filename>
10139N/A/usr/lib/pkgconfig</filename> for these files. It also looks in the colon-separated list of directories specified by the <envar>PKG_CONFIG_PATH</envar>
10139N/Aenvironment variable.</para>
10139N/A<para>The package name specified on the <command>&cmd;</command> command line
10139N/Ais defined to be the name of the metadata file, without the <filename>.pc
10139N/A</filename> extension. If a library can install multiple versions simultaneously,
10139N/Ait must give each version its own name. For example, GTK 1.2 might have the
10139N/Apackage name <literal>gtk+</literal> while GTK 2.0 has the package name <literal>
10139N/Agtk+-2.0</literal>.</para>
10139N/A</refsect1>
10139N/A<refsect1 id="pkg-config-1-exde"><title>&exde-tt;</title>
10139N/A<para>A <filename>.pc</filename> file has two kinds of line:</para>
10139N/A<itemizedlist>
10139N/A<listitem><para>Keyword lines start with a keyword and a colon.</para></listitem>
10139N/A<listitem><para>Variable definitions start with an alphanumeric string and
10139N/Aan equals sign.</para></listitem>
10139N/A</itemizedlist>
10139N/A<para>Keywords are defined in advance and have special meaning to <command>&cmd;</command>.
10139N/AVariables do not have special meaning, you can specify any variables that
10139N/Ayou wish. However, users may expect to retrieve the usual directory name variables.
10139N/A</para>
10139N/A<para>Note that variable references are written "${foo}"; you can escape literal
10139N/A"${" as "$${".</para>
10139N/A<para><command>&cmd;</command> supports the following keywords:</para>
10139N/A<variablelist termlength="medium">
10139N/A<varlistentry><term><literal>Name</literal></term><listitem><para>A human-readable
10139N/Aname for the package. Note that it is not the name passed as an argument to <command>&cmd;</command>.
10139N/A</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Description</literal></term><listitem><para>
10139N/AA brief description of the package.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>URL</literal></term><listitem><para>
10139N/AA URL where people can get more information about and download the package.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Version</literal></term><listitem><para>
10139N/AThe most-specific-possible package version string.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Requires</literal></term><listitem><para>A comma-separated
10139N/Alist of packages that are required by your package. Flags from dependent packages
10139N/Awill be merged in to the flags reported for your package. Optionally, you
10139N/Acan specify the version of the required package (using the operators =, &lt;,
10139N/A&gt;, &gt;=, &lt;=). Specifying a version allows <command>&cmd;</command> to perform
10139N/Aextra sanity checks. You may only mention the same package once on the Requires:
10139N/Aline. If the version of a package is not specified, any version will be used
10139N/Awith no checking.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Conflicts</literal></term><listitem><para>Optional.
10139N/AAllows <command>&cmd;</command> to perform additional sanity checks, primarily
10139N/Ato detect broken user installations. The syntax is the same as Requires: except
10139N/Athat you can list the same package more than once, for example "foobar = 1.2.3,
10139N/Afoobar = 1.2.5, foobar >= 1.3", if you have reason to do so. If a version
10139N/Ais not specified, your package conflicts with all versions of the mentioned
10139N/Apackage. If a user tries to use your package and a conflicting package at
10139N/Athe same time, <command>&cmd;</command> complains.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Libs</literal></term><listitem><para>The link
10139N/Aflags specific to your package. Do not add any flags for required packages,
10139N/A<command>&cmd;</command> adds these automatically.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Libs.private</literal></term><listitem><para>
10139N/AThis line should list any private libraries in use. Private libraries are
10139N/Alibraries which are not exposed through your library, but are needed in the
10139N/Acase of static linking.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><literal>Cflags</literal></term><listitem><para>The compile
10139N/Aflags specific to your package. Do not add any flags for required packages, <command>&cmd;</command>
10139N/Aadds these automatically.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A</variablelist><para>See the EXAMPLES section below for a sample <filename>
10139N/A.pc</filename> file.</para>
10139N/A</refsect2>
10139N/A<refsect2>
10139N/A<title>autoconf Macros</title>
10139N/A<para><literal>PKG_CHECK_MODULES([<replaceable>variablebase</replaceable>], [<replaceable>modulelist</replaceable>], [<replaceable>action-if-found</replaceable>], [<replaceable>action-if-not-found</replaceable>]) </literal></para>
10139N/A
10139N/A<para>The macro PKG_CHECK_MODULES can be used in <filename>configure.in</filename>
10139N/Ato check whether modules exist, as shown in the following example: </para>
10139N/A<screen>PKG_CHECK_MODULES([MYSTUFF], [gtk+-2.0 >= 1.3.5 libxml = 1.8.4]) </screen>
10139N/A<para>In this example, the MYSTUFF_LIBS and MYSTUFF_CFLAGS substitution variables
10139N/Aare set to the <literal>libs</literal> and <literal>cflags</literal> values
10139N/Afor the given module list. If a module is missing or has the wrong version,
10139N/Aby default <literal>configure</literal> will abort with a message. To replace
10139N/Athe default action, specify an <replaceable>action-if-found</replaceable>.
10139N/APKG_CHECK_MODULES will not print any error messages if you specify your own
10139N/A<replaceable>action-if-not-found</replaceable>. However, it will set the variable
10139N/A<envar>MYSTUFF_PKG_ERRORS</envar>, which you can use to find out what went wrong.
10139N/A</para>
10139N/A<para><literal>PKG_PROG_PKG_CONFIG([<replaceable>minversion</replaceable>])</para>
10139N/A<para>
10139N/AThe macro PKG_PROG_PKG_CONFIG defines the PKG_CONFIG variable to the best
10139N/Apkg-config availabl, useful if you need &cmd;, but do not want to use
10139N/Athe PKG_CHECK_MODULES macro.</para>
10139N/A</refsect2>
10139N/A<refsect2>
10139N/A<title>Compiling 64&ndash;Bit Binaries</title>
10139N/A<para>To compile 64&ndash;bit binaries, <command>&cmd;</command> must use
10139N/Ametadata files that specify the flags for the 64-bit libraries. To ensure
10139N/Athat <command>&cmd;</command> can find the metadata files for 64-bit libraries,
10139N/Aset the <envar>PKG_CONFIG_PATH</envar> environment variable to <filename>
10139N/A/usr/lib/64/pkgconfig/</filename> when compiling 64-bit software<?Pub Caret>.
10139N/A</para>
10139N/A</refsect2>
10139N/A</refsect1>
10139N/A<refsect1 id="pkg-config-1-opts"><title>&opts-tt;</title>
10139N/A<para>The following options are supported:</para>
10139N/A<variablelist termlength="wholeline">
10139N/A
10139N/A<varlistentry><term><option>-atleast-pkgconfig-version=<replaceable>version</replaceable></option></term>
10139N/A<listitem><para>Require a specific <replaceable>version</replaceable> of pkg-config.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-atleast-version=<replaceable>version</replaceable></option></term>
10139N/A<listitem><para>See the entry for the <option>-exists</option> option.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-cflags</option></term><listitem><para>Prints
10139N/Apre-processor and compile flags required to compile the packages on the command
10139N/Aline, including flags for all their dependencies. Flags are "compressed" so
10139N/Athat each identical flag appears only once. <command>&cmd;</command> exits
10139N/Awith a nonzero code if it cannot find metadata for one or more of the packages
10139N/Aon the command line.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-cflags-only-I</option></term><listitem><para>
10139N/ASame as <option>cflags</option> except it prints only -I flags.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-cflags-only-other</option></term><listitem><para>
10139N/ASame as <option>cflags</option> except it prints only flags not covered by the <option>cflags-only-I</option> option.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-define-variable=<replaceable>variablename</replaceable>=<replaceable>value</replaceable></option></term><listitem><para>Sets a global value
10139N/Afor a variable, overriding the value in any <filename>.pc</filename> files. Most
10139N/Apackages define the variable "prefix" in their <filename>.pc</filename>, so to override
10139N/Athis, for example:</para>
10139N/A<screen>$ <userinput>&cmd; --print-errors --define-variable=prefix=/foo \\
10139N/A --variable=prefix glib-2.0 /foo</userinput></screen>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-debug</option></term><listitem><para>
10139N/AShow verbose debug information.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-errors-to-stdout</option></term><listitem><para>
10139N/AIf printing errors, print them to <literal>stdout</literal> rather than the
10139N/Adefault <literal>stderr</literal>.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-exact-version=<replaceable>version</replaceable></option></term>
10139N/A<listitem><para>See the entry for the <option>-exists</option> option.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-exists</option></term><listitem><para>The <option>
10139N/A-exists</option>, <option>-atleast-version=<replaceable>version</replaceable></option>, <option>
10139N/A-exact-version=<replaceable>version</replaceable></option>, and <option>-max-version=<replaceable>
10139N/Aversion</replaceable></option> options test whether the packages on the command
10139N/Aline are known to <command>&cmd;</command>, and optionally whether the version
10139N/Anumber of a package meets certain contraints. If all packages exist and meet
10139N/Athe specified version constraints, <command>&cmd;</command> exits successfully.
10139N/AOtherwise, <command>&cmd;</command> exits unsuccessfully. Rather than using
10139N/Athe version-test options, you can simply give a version constraint after each
10139N/Apackage name, as shown in the following example:</para>
10139N/A<screen>$ <userinput>&cmd; --exists 'glib-2.0 >= 1.3.4 libxml = 1.8.3'</userinput></screen>
10139N/A<para>Remember to use the <option>-print-errors</option> option if you want
10139N/Ato display error messages.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-help</option></term><listitem><para>Displays
10139N/Ahelp and usage information.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-libs</option></term><listitem><para>Identical
10139N/Ato <option>-cflags</option> option but only prints the link flags. Duplicate
10139N/Aflags are merged, maintaining proper ordering, and flags for dependencies
10139N/Aare included in the output.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-libs-only-L</option></term><listitem><para>
10139N/ASame as <option>libs</option> except it prints only -L and -R flags.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-libs-only-l</option></term><listitem><para>
10139N/ASame as <option>libs</option> except it prints only -l flags.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-libs-only-other</option></term><listitem><para>
10139N/ASame as <option>libs</option> except it prints only flags not covered by the <option>libs-only-L</option> and <option>libs-only-l</option> options, such as "-pthread".</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-list-all</option></term><listitem><para>
10139N/AList all known packages.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-max-version=<replaceable>version</replaceable></option></term>
10139N/A<listitem><para>See the entry for the <option>-exists</option> option.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-modversion</option></term><listitem><para>Requests
10139N/Athat the version information of the libraries specified on the command line
10139N/Abe displayed. If <command>&cmd;</command> can find all of the libraries on
10139N/Athe command line, each library's version string is printed to <literal>stdout
10139N/A</literal>, one version per line. In this case <command>&cmd;</command> exits
10139N/Asuccessfully. If one or more libraries is unknown, <command>&cmd;</command>
10139N/Aexits with a nonzero code, and the contents of <literal>stdout</literal> are
10139N/Aundefined.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-print-errors</option></term><listitem><para>
10139N/ADisplays an error if one or more of the modules on the command line, or their
10139N/Adependencies, are not found, or if an error occurs in parsing. With "predicate"
10139N/Aoptions such as <option>--exists</option>, &cmd; runs silently by default,
10139N/Abecause it's usually used in scripts that want to control what's output.
10139N/AThis option can be used alone to just print errors encountered locating modules
10139N/Aon the command line, or with other options. The <envar>PKG_CONFIG_DEBUG_SPEW</envar>
10139N/Aenvironment variable overrides this option.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-silence-errors</option></term><listitem><para>
10139N/ADoes not display an error if one or more of the modules on the command line,
10139N/Aor their dependencies, are not found, or if an error occurs in parsing. With
10139N/Apredicate options such as <option>-exists</option>, <command>&cmd;</command>
10139N/Aruns silently by default, because it is usually used in scripts that want
10139N/Ato control what is output. This option is only useful with options that print
10139N/Aerrors by default, such as <option>-cflags</option> or <option>-modversion
10139N/A</option>. The <envar>PKG_CONFIG_DEBUG_SPEW</envar> environment variable overrides
10139N/Athis option.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-short-errors</option></term><listitem><para>
10139N/APrints short errors. Refer to <option>print-errors</option> for more detail
10139N/Aabout how &cmd; manages error messages.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-uninstalled</option></term><listitem><para>Normally,
10139N/Aif you request the package <filename>foo</filename> and the package <filename>
10139N/Afoo-uninstalled</filename> exists, <command>&cmd;</command> will prefer the
10139N/Auninstalled variant. This allows compilation/linking against uninstalled packages.
10139N/AIf you specify the <option>-uninstalled</option> option, <command>&cmd;</command>
10139N/Areturns successfully if any uninstalled packages are being used. Otherwise, <command>&cmd;</command>
10139N/Afails. The <envar>PKG_CONFIG_DISABLE_UNINSTALLED</envar> environment variable
10139N/Aprevents <command>&cmd;</command> from implicitly choosing uninstalled packages.
10139N/AIf the <envar>PKG_CONFIG_DISABLE_UNINSTALLED</envar> variable is set, uninstalled
10139N/Apackages are used only if you explicitly pass a name such as <filename>foo-uninstalled
10139N/A</filename> on the command line.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-usage</option></term><listitem><para>Displays
10139N/Ahelp and usage information.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term><option>-variable=<replaceable>variablename</replaceable></option></term>
10139N/A<listitem><para>Returns the value of a variable defined in a package's <filename>
10139N/A.pc</filename> file. For example, most packages define the variable <literal>
10139N/Aprefix</literal>: </para>
10139N/A<screen>$ <userinput>&cmd; --variable=prefix glib-2.0 /usr/</userinput></screen>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect1>
10139N/A
10139N/A<refsect1 id="pkg-config-1-oper"><title>&oper-tt;</title>
10139N/A<para>The following operands are supported:</para>
10139N/A<variablelist termlength="medium">
10139N/A<varlistentry><term><option role="nodash"><replaceable>libraries</replaceable></option></term>
10139N/A<listitem><para>List of libraries specified by the metadata file found in
10139N/A<filename>/usr/lib/pkgconfig</filename, without the <filename>.pc</filename>
10139N/Aextension.</para>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect1>
10139N/A
10139N/A<refsect1 id="pkg-config-1-envr"><title>&envr-tt;</title>
10139N/A<para>See <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>
10139N/A5</manvolnum></citerefentry> for descriptions of environment variables.</para>
10139N/A
10139N/A<variablelist termlength="wide">
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_ALLOW_SYSTEM_CFLAGS</envar></term><listitem>
10139N/A<para> Do not strip <literal>-I/usr/include</literal> from <literal>cflags
10139N/A</literal>.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_ALLOW_SYSTEM_LIBS</envar></term><listitem>
10139N/A<para>Do not strip <literal>-L/usr/lib</literal> from <literal>libs</literal>.
10139N/A</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_DEBUG_SPEW</envar></term><listitem>
10139N/A<para>If set, causes <command>&cmd;</command> to print all debugging information
10139N/Aand report all errors.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_DISABLE_UNINSTALLED</envar></term><listitem>
10139N/A<para> Normally, if you request the package <filename>foo</filename> and the
10139N/Apackage <filename>foo-uninstalled</filename> exists, <command>&cmd;</command>
10139N/Aprefers the uninstalled variant. This allows compilation/linking against
10139N/Auninstalled packages. If the <envar>PKG_CONFIG_DISABLE_UNINSTALLED</envar>
10139N/Aenvironment variable is set, <command>&cmd;</command> prefers the
10139N/Ainstalled variant.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_LIBDIR</envar></term><listitem><para>
10139N/AReplaces the default pkg-config search directory.</para>
10139N/A</listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_PATH</envar></term><listitem><para>
10139N/AA colon-separated list of directories to search for <filename>.pc</filename>
10139N/Afiles. The default directory is always searched after searching the path
10139N/Aspecified by <envar>PKG_CONFIG_PATH</envar>. The default value of
10139N/A<envar>PKG_CONFIG_PATH</envar> is <filename>/usr/lib/pkgconfig</filename>.
10139N/A</para></listitem></varlistentry>
10139N/A
10139N/A<varlistentry><term>
10139N/A<envar>PKG_CONFIG_TOP_BUILD_DIR</envar></term><listitem>
10139N/A<para>Sets the value of the magic variable <literal>pc_top_builddir</literal>,
10139N/Awhich may appear in <filename>.pc</filename> files. If this environment variable
10139N/Ais not set, the default value <literal>'$(top_builddir)'</literal> is used.
10139N/AThe <envar>PKG_CONFIG_TOP_BUILD_DIR</envar> variable should refer to the top
10139N/Abuilddir of the Makefile where the compile/link flags reported by <command>&cmd;</command>
10139N/Aare used. The <envar>PKG_CONFIG_TOP_BUILD_DIR</envar> variable is only used
10139N/Awhen compiling/linking against a package that has not yet been installed.
10139N/A</para></listitem></varlistentry>
10139N/A
10139N/A</variablelist></refsect1>
10139N/A<refsect1 id="pkg-config-1-exam"><title>&exam-tt;</title>
10139N/A<example role="example">
10139N/A<title>Example .pc File</title>
10139N/A<para>Here is an example <filename>.pc</filename> file: </para>
10139N/A<programlisting># This is a comment
10139N/Aprefix=/usr # this defines a variable
10139N/Aexec_prefix=${prefix} # defining another variable in terms of the first
10139N/Alibdir=${exec_prefix}/lib
10139N/Aincludedir=${prefix}/include
10139N/A
10139N/AName: GObject# human-readable name
10139N/ADescription: Object/type system for GLib # human-readable description
10139N/AVersion: 1.3.1
10139N/ARequires: glib-2.0 = 1.3.1
10139N/AConflicts: foobar &lt;= 4.5
10139N/ALibs: -L${libdir} -lgobject-1.3
10139N/ACflags: -I${includedir}/glib-2.0 -I${libdir}/glib/include
10139N/A
10139N/A</programlisting>
10139N/A</example>
10139N/A<example role="example">
10139N/A<title>Adding a Library to the Set of Packages Known to &cmd;</title>
10139N/A<para>To add a library to the set of packages known to <command>&cmd;</command>,
10139N/Ayou must install the library-specific <filename>.pc</filename> file in the <filename>
10139N/A/usr/lib/pkgconfig</filename> directory.</para>
10139N/A<para>If the .pc file does not exist, generate the file by running the <command>
10139N/Aconfigure</command> command, building, and installing the module that provides it.
10139N/AGenerating the file in this way ensures that the prefix and other variables are
10139N/Aset to the correct values.</para>
10139N/A</example>
10139N/A<example role="example">
10139N/A<title>Getting the Compile Flags Required for the gnomeui Package</title>
10139N/A<para><screen>example% <userinput>&cmd; --cflags libgnomeui-2.0</userinput></screen></para>
10139N/A</example>
10139N/A</refsect1>
10139N/A<refsect1 id="pkg-config-1-file"><title>&file-tt;</title>
10139N/A<para>The following files are used by this application:</para>
10139N/A<variablelist termlength="medium">
10139N/A<varlistentry><term><filename>/usr/bin/&cmd;</filename> </term><listitem>
10139N/A<para>Executable for installed library helper script</para>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect1>
10139N/A<refsect1 id="pkg-config-1-attr"><title>&attr-tt;</title>
10139N/A<para>See <olink targetdocent="REFMAN5" localinfo="attributes-5"><citerefentry>
10139N/A<refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>
10139N/Afor descriptions of the following attributes: </para>
10139N/A<informaltable frame="all">
10139N/A<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="COLSPEC0" colwidth="1*">
10139N/A<colspec colname="COLSPEC1" colwidth="1*">
10139N/A<thead>
10139N/A<row><entry align="center" valign="middle"><para>ATTRIBUTE TYPE</para></entry>
10139N/A<entry align="center" valign="middle"><para>ATTRIBUTE VALUE</para></entry>
10139N/A</row>
10139N/A</thead>
10139N/A<tbody>
10139N/A<row><entry><para>Availability</para></entry><entry><para>SUNWgnome-common-devel
10139N/A</para></entry></row>
10139N/A<row><entry colname="COLSPEC0"><para>Interface stability</para></entry><entry
10139N/Acolname="COLSPEC1"><para>Committed</para></entry></row>
10139N/A</tbody>
10139N/A</tgroup>
10139N/A</informaltable>
10139N/A</refsect1>
10139N/A<refsect1 id="pkg-config-1-also"><title>&also-tt;</title>
10139N/A<!--Reference to another man page-->
10139N/A<!--Reference to a Help manual-->
10139N/A<!--Reference to a book.-->
10139N/A<para>Latest version of the <citetitle>GNOME Desktop User Guide</citetitle>
10139N/Afor your platform.</para>
10139N/A</refsect1>
10139N/A<refsect1 id="pkg-config-1-note"><title>&note-tt;</title>
10139N/A<para>Updated by Brian Cameron, Sun Microsystems Inc., 2003, 2004. Written
10139N/Aby James Henstridge, Martijn van Beers, Havoc Pennington, Tim Janik, Owen
10139N/ATaylor, Raja Harinath, Miguel de Icaza.</para>
10139N/A</refsect1>
10139N/A</refentry>
10139N/A<?Pub *0000023873>