[BACK]Return to pkg-config.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / pkg-config

Annotation of src/usr.bin/pkg-config/pkg-config.1, Revision 1.32

1.32    ! jasper      1: .\"    $OpenBSD: pkg-config.1,v 1.31 2015/02/28 21:51:56 bentley Exp $
1.1       ckuethe     2: .\"
                      3: .\"    Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org>
                      4: .\"
                      5: .\"    Permission to use, copy, modify, and distribute this software for any
                      6: .\"    purpose with or without fee is hereby granted, provided that the above
                      7: .\"    copyright notice and this permission notice appear in all copies.
                      8: .\"
                      9: .\"    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\"    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\"    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\"    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\"    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14: .\"    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15: .\"    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16: .\"
1.32    ! jasper     17: .Dd $Mdocdate: February 28 2015 $
1.6       jmc        18: .Dt PKG-CONFIG 1
1.1       ckuethe    19: .Os
                     20: .Sh NAME
                     21: .Nm pkg-config
                     22: .Nd fetch metadata about installed software packages
                     23: .Sh SYNOPSIS
                     24: .Nm pkg-config
                     25: .Op Ar options
                     26: .Ar pkg-name Op Ar pkg-name ...
                     27: .Sh DESCRIPTION
                     28: The
                     29: .Nm
1.10      jmc        30: utility retrieves metadata about the installation of software packages.
1.1       ckuethe    31: This metadata includes version, compiler and linker flags, and dependency
                     32: information.
1.6       jmc        33: It is inspired by, and intended to operate as a drop-in replacement to,
                     34: the program of the same name available from freedesktop.org.
1.1       ckuethe    35: .Pp
                     36: Metadata is stored in files named after the package they describe; the
                     37: Yoyodyne package would likely be described by "yoyodyne.pc".
1.2       ckuethe    38: Not all software packages provide
                     39: .Nm
1.6       jmc        40: metadata.
1.15      jasper     41: Libraries from base install their metadata in
                     42: .Pa /usr/lib/pkgconfig ;
                     43: packages controlled by the
1.1       ckuethe    44: .Xr ports 7
1.28      espie      45: system store their metadata in
1.26      ajacouto   46: .Pa ${LOCALBASE}/lib/pkgconfig
                     47: and
                     48: .Pa ${LOCALBASE}/share/pkgconfig ;
1.2       ckuethe    49: the X Window System stores its metadata in
1.26      ajacouto   50: .Pa ${X11BASE}/lib/pkgconfig
                     51: and
                     52: .Pa ${X11BASE}/share/pkgconfig .
1.2       ckuethe    53: The
                     54: .Nm
                     55: utility will search these locations by default.
1.1       ckuethe    56: .Pp
1.2       ckuethe    57: Because
                     58: .Nm
                     59: attempts to output the full set of compiler or linker flags required to
                     60: use a package, it will also output the flags required for any prerequisite
                     61: packages.
1.6       jmc        62: If the "foo" package depends on the "bar" package, "pkg-config --cflags foo"
1.2       ckuethe    63: might output something like "-I/usr/local/include/foo
                     64: -I/usr/local/include/bar", even though the compiler flags for "bar" were not
                     65: explicitly requested.
1.1       ckuethe    66: .Pp
                     67: The options are as follows:
                     68: .Bl -tag -width Ds
1.7       jmc        69: .It Cm --atleast-pkgconfig-version Ar version
1.4       ckuethe    70: Exit with error if the version of
1.1       ckuethe    71: .Nm
1.12      jmc        72: is not greater than or equal to the specified version.
1.7       jmc        73: .It Cm --atleast-version Ar version
                     74: Exit with error if the specified package's version is not greater than
                     75: or equal to the specified version.
                     76: .It Cm --cflags
1.1       ckuethe    77: Return all compiler flags required to compile against the package.
1.7       jmc        78: .It Cm --cflags-only-I
1.1       ckuethe    79: Return only the include path flags required to compile against the package.
1.7       jmc        80: .It Cm --cflags-only-other
1.1       ckuethe    81: Return all compiler flags, other than the include path flags, required to
                     82: compile against the package.
1.7       jmc        83: .It Cm --debug
                     84: Enable internal development and debugging messages.
                     85: .It Cm --errors-to-stdout
                     86: Direct error messages to stdout rather than stderr.
1.29      jasper     87: .It Cm --exact-version Ar version
                     88: Exit with error if the specified packages's version does not equal the
                     89: specified version.
1.7       jmc        90: .It Cm --exists
                     91: Return true if all the specified packages are installed.
1.9       jmc        92: This is the default operation.
1.31      bentley    93: .It Cm --help | --usage
1.7       jmc        94: Print a help message and exit.
                     95: .It Cm --libs
1.8       jmc        96: Return all linker flags required to link against the package.
1.12      jmc        97: .It Cm --libs-only-L
                     98: Return only the library path (-L/path/to/lib) flags required to link
                     99: against the package.
1.7       jmc       100: .It Cm --libs-only-l
1.1       ckuethe   101: Return only the library (-lwhatever) flags required to link against
                    102: the package.
1.7       jmc       103: .It Cm --libs-only-other
1.1       ckuethe   104: Return linker flags, other than the library and path flags, required to
                    105: compile against the package.
1.7       jmc       106: .It Cm --list-all
                    107: List all installed packages and exit.
1.29      jasper    108: .It Cm --max-version Ar version
                    109: Exit with error if the specified package's version is greater than
                    110: the specified version.
1.7       jmc       111: .It Cm --modversion
1.3       ckuethe   112: Fetch package version.
                    113: If no package is given,
                    114: .Nm
                    115: returns its own version.
1.7       jmc       116: .It Cm --print-errors
                    117: Print error messages and exit with an error when errors occur.
1.9       jmc       118: This is the default operation.
1.17      jasper    119: .It Cm --print-provides
                    120: Print all the modules the given package provides.
                    121: .It Cm --print-requires
                    122: Print all the modules the given package requires.
                    123: .It Cm --print-requires-private
                    124: Print all the modules the given package requires for static linking.
1.7       jmc       125: .It Cm --silence-errors
                    126: Do not print error messages, just exit with an error.
                    127: .It Cm --static
                    128: Return the compiler and/or linker flags required for static linking.
                    129: .It Cm --uninstalled
                    130: Allow packages not controlled by
                    131: .Nm
                    132: to be used.
1.32    ! jasper    133: .It Cm --validate
        !           134: Validate the package without processing its dependencies.
1.7       jmc       135: .It Cm --variable Ar name
1.1       ckuethe   136: Fetch the value of the named variable.
1.7       jmc       137: .It Cm --version
                    138: Print version of
                    139: .Nm
                    140: and exit.
1.1       ckuethe   141: .El
                    142: .Sh ENVIRONMENT
1.16      jasper    143: .Bl -tag -width Ds
                    144: .It Ev PKG_CONFIG_DEBUG_SPEW
                    145: If set, this will cause
                    146: .Nm
                    147: to print various debugging information.
                    148: .It Ev PKG_CONFIG_DISABLE_UNINSTALLED
                    149: By default
                    150: .Nm
                    151: prefers a package named "foo-uninstalled" over "foo" when the package
                    152: "foo" is requested.
                    153: This allows linking/compiling against uninstalled packages.
                    154: Setting this flag disables the default behaviour.
                    155: .It Ev PKG_CONFIG_LIBDIR
                    156: This can be used to specify a colon-separated list of paths to search for
                    157: package files.
                    158: This will replace the default
                    159: .Nm
                    160: search directory.
1.22      jasper    161: .It Ev PKG_CONFIG_LOG
1.19      jasper    162: This is used to specify a log file to which
1.16      jasper    163: .Nm
                    164: will write the passed arguments.
1.1       ckuethe   165: .It Ev PKG_CONFIG_PATH
                    166: This can be used to specify a colon-separated list of paths to search for
                    167: package files.
                    168: If given, this list of paths is prepended to the standard search path.
1.18      jasper    169: .It Ev PKG_CONFIG_SYSROOT_DIR
                    170: This modifies
                    171: .Fl I
                    172: and
                    173: .Fl L
                    174: to use the target sysroot directory.
                    175: Thus -I/usr/local/include will become -I/target/usr/local/include when
1.19      jasper    176: PKG_CONFIG_SYSROOT_DIR is set to /target, which is useful when cross compiling
1.18      jasper    177: packages that use
                    178: .Nm .
1.16      jasper    179: .It Ev PKG_CONFIG_TOP_BUILD_DIR
                    180: If set
                    181: .Nm
                    182: uses the specified value for
                    183: .Em pc_top_builddir
                    184: instead of $(top_builddir).
1.1       ckuethe   185: .El
1.14      jmc       186: .Sh EXIT STATUS
                    187: .Ex -std pkg-config
1.1       ckuethe   188: .Sh SEE ALSO
                    189: .Xr pkg_info 1 ,
                    190: .Xr ports 7
                    191: .Sh HISTORY
                    192: The
                    193: .Nm
                    194: utility first appeared in
1.11      jmc       195: .Ox 4.1 .
1.20      jasper    196: .Sh AUTHORS
                    197: .Nm
                    198: was written by
1.30      schwarze  199: .An Chris Kuethe Aq Mt ckuethe@openbsd.org
1.20      jasper    200: as a replacement for the original freedesktop.org
                    201: .Nm
                    202: implementation.
                    203: It was later extended and kept in sync (where relevant) with the original
                    204: version by
1.30      schwarze  205: .An Marc Espie Aq Mt espie@openbsd.org
1.20      jasper    206: and
1.30      schwarze  207: .An Jasper Lievisse Adriaanse Aq Mt jasper@openbsd.org .
1.23      jasper    208: .Sh CAVEATS
                    209: .Nm
                    210: is a re-implementation of the "original" freedesktop.org program.
                    211: While it tries to be compatible, there are several
                    212: design/functionality differences one should be aware of:
                    213: .Bl -tag -width Ds
                    214: .It Ev Conflicts
                    215: It was decided not to support the Conflicts keyword as there is
                    216: currently too little benefit from it in
                    217: .Ox
                    218: where the ports tree is supposed to prevent conflicts from arising
                    219: in the first place.
                    220: Lines with this keyword are not treated as errors, they are just ignored.
                    221: And they are not taken into account when
                    222: .Cm --print-errors
                    223: is passed.
                    224: .It Ev Cflags and -i
                    225: The
                    226: .Fl i
                    227: flag that can be encountered in Cflags is not treated differently from
                    228: .Fl I
                    229: in this implementation.
                    230: .It Ev Whitespace
                    231: .Nm
                    232: does not go to great lengths to try to fix whitespace abuse.
                    233: Whitespace in Libs and Cflags lines that are escaped using \e are
                    234: treated correctly.
                    235: But strings enclosed in quotation marks that contain whitespaces are not.
                    236: .El