Name Date Size #Lines LOC

..--

cli/H--7,0704,632

doc/H--1,477807

fuzzer/H--902598

libpkgconf/H--10,6216,387

m4/H--5451

man/H--1,5941,586

t/H--2,1981,832

tests/H--11,2369,097

AUTHORSH A D01-Jul-20263.5 KiB9897

CODE_OF_CONDUCT.mdH A D22-Apr-20261 KiB2818

CONTRIBUTING.mdH A D01-Jul-20263.4 KiB11175

COPYINGH A D01-Jul-2026468 107

DCOH A D01-Jul-20261.3 KiB3525

Makefile.amH A D01-Jul-202628.4 KiB784750

Makefile.liteH A D01-Jul-20264.6 KiB12492

NEWSH A D01-Jul-202639.1 KiB1,102838

README.mdH A D01-Jul-20266.7 KiB167114

autogen.shH A D01-Jul-20261.5 KiB8868

codecov.ymlH A D01-Jul-2026573 2416

configure.acH A D01-Jul-20263.9 KiB10688

libpkgconf.pc.inH A D01-Jul-2026458 1715

meson.buildH A D01-Jul-202614.8 KiB481430

meson_options.txtH A D01-Jul-2026539 2723

pkg.m4H A D01-Jul-202612.4 KiB342300

pkgconf.manifest.inH A D01-Jul-2026397 109

pkgconf.rc.inH A D01-Jul-202653 32

pkgconf.wxs.inH A D01-Jul-20262 KiB5750

txt2rtf.pyH A D22-Apr-20261.2 KiB3625

README.md

1# pkgconf [![test](https://github.com/pkgconf/pkgconf/actions/workflows/test.yml/badge.svg)](https://github.com/pkgconf/pkgconf/actions/workflows/test.yml) [![Coverage](https://img.shields.io/codecov/c/github/pkgconf/pkgconf)](https://app.codecov.io/github/pkgconf/pkgconf)
2
3`pkgconf` is a program which helps to configure compiler and linker flags for
4development libraries.  It is a superset of the functionality provided by
5pkg-config from freedesktop.org, but does not provide bug-compatibility with
6the original pkg-config.
7
8`libpkgconf` is a library which provides access to most of `pkgconf`'s functionality,
9to allow other tooling such as compilers and IDEs to discover and use libraries
10configured by pkgconf.
11
12`bomtool` and `spdxtool` are programs generating software bill of materials (SBOM)
13for a given set of pkg-config modules, in the SPDX 2.0 and SPDX Lite 3.0.1 format,
14respectively.  The output of these tools can then be translated into other SBOM
15formats as necessary.
16
17## release tarballs
18
19Release tarballs are available on [distfiles.ariadne.space][distfiles].
20
21   [distfiles]: https://distfiles.ariadne.space/pkgconf/
22
23## build system setup
24
25pkgconf uses [Meson](https://mesonbuild.com) as its build system.
26
27> **Note:** The autotools build system is deprecated as of pkgconf 3.0 and will be
28> removed in pkgconf 3.1.  New build configurations should use Meson or Muon.
29
30If you would like to use the git sources directly, or a snapshot of the sources from
31GitHub, Meson can be used directly without any additional bootstrap step.
32
33## pkgconf-lite
34
35If you only need the original pkg-config functionality, there is also pkgconf-lite,
36which builds the `pkgconf` frontend and relevant portions of `libpkgconf` functionality
37into a single binary:
38
39    $ make -f Makefile.lite
40
41## why `pkgconf` over original `pkg-config`?
42
43pkgconf builds a flattened directed dependency graph, which allows for more insight
44into relationships between dependencies, allowing for some link-time dependency
45optimization, which allows for the user to more conservatively link their binaries,
46which may be helpful in some environments, such as when prelink(1) is being used.
47
48The solver is also optimized to handle large dependency graphs with hundreds of
49thousands of edges, which can be seen in any project using the Abseil frameworks
50for example.
51
52In addition, pkgconf has full support for virtual packages, while the original
53pkg-config does not, as well as fully supporting `Conflicts` at dependency
54resolution time, which is more efficient than checking for `Conflicts` while
55walking the dependency graph.
56
57## linker flags optimization
58
59pkgconf, when used effectively, can make optimizations to avoid overlinking binaries.
60
61This functionality depends on the pkg-config module properly declaring its dependency
62tree instead of using `Libs` and `Cflags` fields to directly link against other modules
63which have pkg-config metadata files installed.
64
65The practice of using `Libs` and `Cflags` to describe unrelated dependencies is
66not recommended in [Dan Nicholson's pkg-config tutorial][fd-tut] for this reason.
67
68   [fd-tut]: http://people.freedesktop.org/~dbn/pkg-config-guide.html
69
70## bug compatibility with original pkg-config
71
72In general, we do not provide bug-level compatibility with pkg-config.
73
74What that means is, if you feel that there is a legitimate regression versus pkg-config,
75do let us know, but also make sure that the .pc files are valid and follow the rules of
76the [pkg-config tutorial][fd-tut], as most likely fixing them to follow the specified
77rules will solve the problem.
78
79## debug output
80
81Please use only the stable interfaces to query pkg-config.  Do not screen-scrape the
82output from `--debug`: this is sent to `stderr` for a reason, it is not intended to be
83scraped.  The `--debug` output is **not** a stable interface, and should **never** be
84depended on as a source of information.  If you need a stable interface to query pkg-config
85which is not covered, please get in touch.
86
87## compiling `pkgconf` and `libpkgconf`
88
89pkgconf is compiled using [Meson](https://mesonbuild.com):
90
91    $ meson setup build
92    $ meson compile -C build
93    $ meson install -C build
94
95If you are installing pkgconf into a custom prefix, such as `/opt/pkgconf`, you will
96likely want to define the default system includedir and libdir for your toolchain.
97To do this, use the `SYSTEM_LIBDIR` and `SYSTEM_INCLUDEDIR` Meson options like so:
98
99    $ meson setup build \
100         --prefix=/opt/pkgconf \
101         -DSYSTEM_LIBDIR=/lib:/usr/lib \
102         -DSYSTEM_INCLUDEDIR=/usr/include
103    $ meson compile -C build
104    $ meson install -C build
105
106There are a few additional defines such as `PKGCONFIGDIR`.  On Windows, the default
107`PKGCONFIGDIR` value is usually overridden at runtime based on path relocation.
108
109### bootstrapping with Muon
110
111In bootstrap environments where Python is not yet available, pkgconf can also be
112built with [Muon](https://muon.build), a C implementation of the Meson build
113description language.  The same `meson.build` files are used; no separate
114configuration is needed.  Both Meson and Muon are tested in CI.
115
116    $ muon setup build
117    $ samu -C build
118    $ muon install -C build
119
120For non-bootstrap builds, Meson is recommended.
121
122## compiling `pkgconf` and `libpkgconf` with autotools (deprecated)
123
124> **Warning:** The autotools build system is deprecated as of pkgconf 3.0 and will be
125> removed in pkgconf 3.1.  Please migrate to Meson or Muon.
126
127If you would like to use the git sources directly, or a snapshot of the sources from
128GitHub, you will need to regenerate the autotools build system artifacts yourself, or
129use Meson instead (recoommended).  For example, on Alpine:
130
131    $ apk add autoconf automake libtool build-base
132    $ sh ./autogen.sh
133
134pkgconf is then compiled the same way as any other autotools-based project:
135
136    $ ./configure
137    $ make
138    $ sudo make install
139
140If you are installing pkgconf into a custom prefix, such as `/opt/pkgconf`, you will
141likely want to define the default system includedir and libdir for your toolchain.
142To do this, use the `--with-system-includedir` and `--with-system-libdir` configure
143flags like so:
144
145    $ ./configure \
146         --prefix=/opt/pkgconf \
147         --with-system-libdir=/lib:/usr/lib \
148         --with-system-includedir=/usr/include
149    $ make
150    $ sudo make install
151
152## pkg-config symlink
153
154If you want pkgconf to be used when you invoke `pkg-config`, you should install a
155symlink for this.  We do not do this for you, as we believe it is better for vendors
156to make this determination themselves.
157
158    $ ln -sf pkgconf /usr/bin/pkg-config
159
160## contacts
161
162You can report bugs at <https://github.com/pkgconf/pkgconf/issues>.
163
164There is a mailing list at <https://lists.sr.ht/~kaniini/pkgconf>.
165
166You can contact us via IRC at `#pkgconf` at `irc.oftc.net`.
167