1.\" Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016 pkgconf authors (see AUTHORS).
2.\"
3.\" Permission to use, copy, modify, and/or distribute this software for any
4.\" purpose with or without fee is hereby granted, provided that the above
5.\" copyright notice and this permission notice appear in all copies.
6.\"
7.\" This software is provided 'as is' and without any warranty, express or
8.\" implied.  In no event shall the authors be liable for any damages arising
9.\" from the use of this software.
10.Dd November 15, 2016
11.Dt PKGCONF 1
12.Os
13.Sh NAME
14.Nm pkgconf
15.Nd a system for configuring build dependency information
16.Sh SYNOPSIS
17.Nm
18.Op Ar options
19.Op Ar list of modules
20.Sh DESCRIPTION
21.Nm
22is a program which helps to configure compiler and linker flags for
23development libraries.
24This allows build systems to detect other dependencies and use them with the
25system toolchain.
26.Sh GENERAL OPTIONS
27.Bl -tag -width indent
28.It Fl -version
29Display the supported pkg-config version and exit.
30.It Fl -atleast-pkgconfig-version Ns = Ns Ar VERSION
31Exit with error if we do not support the requested pkg-config version.
32.It Fl -errors-to-stdout
33Print all errors on the main output stream instead of the error output stream.
34.It Fl -silence-errors
35Do not display any errors at all.
36.It Fl -list-all
37Walk all directories listed in the
38.Va PKG_CONFIG_PATH
39environmental variable and display information on packages which have registered
40information there.
41.It Fl -simulate
42Simulates resolving a dependency graph based on the requested modules on the
43command line.
44Dumps a series of trees denoting pkgconf's resolver state.
45.It Fl -no-cache
46Skip caching packages when they are loaded into the internal resolver.
47This may result in an alternate dependency graph being computed.
48.It Fl -ignore-conflicts
49Ignore
50.Sq Conflicts
51rules in modules.
52.It Fl -env-only
53Learn about pkgconf's configuration strictly from environmental variables.
54.It Fl -validate Ar package ...
55Validate specific
56.Sq .pc
57files for correctness.
58.It Fl -maximum-traverse-depth Ns = Ns Ar DEPTH
59Impose a limit on the allowed depth in the dependency graph.
60For example, a depth of 2 will restrict the resolver from acting on child
61dependencies of modules added to the resolver's solution.
62.It Fl -static
63Compute a deeper dependency graph and use compiler/linker flags intended for
64static linking.
65.It Fl -shared
66Compute a simple dependency graph that is only suitable for shared linking.
67.It Fl -pure
68Treats the computed dependency graph as if it were pure.
69This is mainly intended for use with the
70.Fl -static
71flag.
72.It Fl -no-provides
73Ignore
74.Sq Provides
75rules in modules when resolving dependencies.
76.It Fl -with-path Ns = Ns Ar PATH
77Adds a new module search path to pkgconf's dependency resolver.
78Paths added in this way are given preference before other paths.
79.It Fl -define-prefix
80Attempts to determine the prefix variable to use for CFLAGS and LIBS entry relocations.
81This is mainly useful for platforms where framework SDKs are relocatable, such as Windows.
82.It Fl -dont-define-prefix
83Disables the
84.Sq define-prefix
85feature.
86.It Fl -prefix-variable Ns = Ns Ar VARIABLE
87Sets the
88.Sq prefix
89variable used by the
90.Sq define-prefix
91feature.
92.It Fl -relocate Ns = Ns Ar PATH
93Relocates a path using the pkgconf_path_relocate API.
94This is mainly used by the testsuite to provide a guaranteed interface
95to the system's path relocation backend.
96.It Fl -dont-relocate-paths
97Disables the path relocation feature.
98.El
99.Sh MODULE-SPECIFIC OPTIONS
100.Bl -tag -width indent
101.It Fl -atleast-version Ns = Ns Ar VERSION
102Exit with error if a module's version is less than the specified version.
103.It Fl -exact-version Ns = Ns Ar VERSION
104Exit with error if a module's version is not exactly the specified version.
105.It Fl -max-version Ns = Ns Ar VERSION
106Exit with error if a module's version is greater than the specified version.
107.It Fl -exists
108Exit with a non-zero result if the dependency resolver was unable to find all of
109the requested modules.
110.It Fl -uninstalled
111Exit with a non-zero result if the dependency resolver uses an
112.Sq uninstalled
113module as part of its solution.
114.It Fl -no-uninstalled
115Forbids the dependency resolver from considering 'uninstalled' modules as part
116of a solution.
117.El
118.Sh QUERY-SPECIFIC OPTIONS
119.Bl -tag -width indent
120.It Fl -cflags , Fl -cflags-only-I , Fl -cflags-only-other
121Display either all CFLAGS, only
122.Fl I
123CFLAGS or only CFLAGS that are not
124.Fl I .
125.It Fl -libs , Fl -libs-only-L , Fl -libs-only-l , Fl -libs-only-other
126Display either all linker flags, only
127.Fl L
128linker flags, only
129.Fl l
130linker flags or only linker flags that are not
131.Fl L
132or
133.Fl l .
134.It Fl -keep-system-cflags , Fl -keep-system-libs
135Keep CFLAGS or linker flag fragments that would be filtered due to being
136included by default in the compiler.
137.It Fl -define-variable Ns = Ns Ar VARNAME Ns = Ns Ar VALUE
138Define
139.Va VARNAME
140as
141.Va VALUE .
142Variables are used in query output, and some modules' results may change based
143on the presence of a variable definition.
144.It Fl -print-variables
145Print all seen variables for a module to the output channel.
146.It Fl -print-provides
147Print all relevant
148.Sq Provides
149entries for a module to the output channel.
150.It Fl -variable Ns = Ns Ar VARNAME
151Print the value of
152.Va VARNAME .
153.It Fl -print-requires , Fl -print-requires-private
154Print the modules included in either the
155.Va Requires
156field or the
157.Va Requires.private
158field.
159.It Fl -digraph
160Dump the dependency resolver's solution as a graphviz
161.Sq dot
162file.
163This can be used with graphviz to visualize module interdependencies.
164.It Fl -path
165Display the filenames of the
166.Sq .pc
167files used by the dependency resolver for a given dependency set.
168.It Fl -env Ns = Ns Ar VARNAME
169Print the requested values as variable declarations in a similar format as the
170.Xr env 1
171command.
172.It Fl -fragment-filter Ns = Ns Ar TYPES
173Filter the fragment lists for the specified types.
174.It Fl -modversion
175Print the version of the queried module.
176.El
177.Sh ENVIRONMENT
178.Bl -tag -width indent
179.It Va PKG_CONFIG_PATH
180List of secondary directories where
181.Sq .pc
182files are looked up.
183.It Va PKG_CONFIG_LIBDIR
184List of primary directories where
185.Sq .pc
186files are looked up.
187.It Va PKG_CONFIG_SYSROOT_DIR
188.Sq sysroot
189directory, will be prepended to every path defined in
190.Va PKG_CONFIG_PATH .
191Useful for cross compilation.
192.It Va PKG_CONFIG_TOP_BUILD_DIR
193Provides an alternative setting for the
194.Sq pc_top_builddir
195global variable.
196.It Va PKG_CONFIG_PURE_DEPGRAPH
197If set, enables the same behaviour as the
198.Fl -pure
199flag.
200.It Va PKG_CONFIG_SYSTEM_INCLUDE_PATH
201List of paths that are considered system include paths by the toolchain.
202This is a pkgconf-specific extension.
203.It Va PKG_CONFIG_SYSTEM_LIBRARY_PATH
204List of paths that are considered system library paths by the toolchain.
205This is a pkgconf-specific extension.
206.It Va PKG_CONFIG_DISABLE_UNINSTALLED
207If set, enables the same behaviour as the
208.Fl -no-uninstalled
209flag.
210.It Va PKG_CONFIG_LOG
211.Sq logfile
212which is used for dumping audit information concerning installed module versions.
213.It Va PKG_CONFIG_DEBUG_SPEW
214If set, enables additional debug logging.
215The format of the debug log messages is implementation-specific.
216.It Va PKG_CONFIG_DONT_RELOCATE_PATHS
217If set, disables the path relocation feature.
218.It Va PKG_CONFIG_MSVC_SYNTAX
219If set, uses MSVC syntax for fragments.
220.It Va PKG_CONFIG_FDO_SYSROOT_RULES
221If set, follow the sysroot prefixing rules that freedesktop.org pkg-config uses.
222.It Va DESTDIR
223If set to PKG_CONFIG_SYSROOT_DIR, assume that PKG_CONFIG_FDO_SYSROOT_RULES is set.
224.El
225.Sh EXAMPLES
226Displaying the CFLAGS of a package:
227.Dl $ pkgconf --cflags foo
228.Dl -fPIC -I/usr/include/foo
229.Sh SEE ALSO
230.Xr pc 5 ,
231.Xr pkg.m4 7
232