1PKG.M4(7) BSD Miscellaneous Information Manual PKG.M4(7)
2
4 pkg.m4 — autoconf macros for using pkgconf
5
7 PKG_PREREQ
8 PKG_PROG_PKG_CONFIG
9 PKG_CHECK_MODULES
10 PKG_CHECK_MODULES_STATIC
11 PKG_INSTALLDIR
12 PKG_NOARCH_INSTALLDIR
13 PKG_CHECK_VAR
14 PKG_WITH_MODULES
15 PKG_HAVE_WITH_MODULES
16 PKG_HAVE_DEFINE_WITH_MODULES
17
19 pkg.m4 is a collection of autoconf macros which help to configure com‐
20 piler and linker flags for development libraries. This allows build sys‐
21 tems to detect other dependencies and use them with the system toolchain.
22
24 PKG_PREREQ(MIN-VERSION)
25 Checks that the version of the pkg.m4 autoconf macros in use is at least
26 MIN-VERSION. This can be used to ensure a particular pkg.m4 macro will
27 be available.
28
29 PKG_PROG_PKG_CONFIG([MIN-VERSION])
30 Checks for an implementation of pkg-config which is at least MIN-VERSION
31 or newer.
32
33 PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES [,ACTION-IF-FOUND [,ACTION-IF-
34 NOT-FOUND]])
35 PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES [,ACTION-IF-FOUND
36 [,ACTION-IF-NOT-FOUND]])
37 Checks whether a given module set exists, and if so, defines CFLAGS and
38 LIBS variables prefixed by VARIABLE-PREFIX with the output from --cflags
39 and --libs respectively.
40
41 The optional ACTION-IF-FOUND and ACTION-IF-NOT-FOUND arguments are shell
42 fragments that should be executed if the module set is found or not
43 found.
44
45 If $PKG_CONFIG is not defined, the PKG_PROG_PKG_CONFIG macro will be exe‐
46 cuted to locate a pkg-config implementation.
47
48 The PKG_CHECK_MODULES_STATIC macro provides the same behaviour as
49 PKG_CHECK_MODULES with static linking enabled via the --static flag.
50
51 PKG_INSTALLDIR(DIRECTORY)
52 Defines the variable $pkgconfigdir as the location where a package should
53 install pkg-config .pc files.
54
55 By default the directory is $libdir/pkgconfig, but the default can be
56 changed by passing the DIRECTORY parameter.
57
58 This value can be overriden with the --with-pkgconfigdir configure param‐
59 eter.
60
61 PKG_NOARCH_INSTALLDIR(DIRECTORY)
62 Defines the variable $noarch_pkgconfigdir as the location where a package
63 should install pkg-config .pc files.
64
65 By default the directory is $datadir/pkgconfig, but the default can be
66 changed by passing the DIRECTORY parameter.
67
68 This value can be overriden with the --with-noarch-pkgconfigdir configure
69 parameter.
70
71 PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, [ACTION-IF-FOUND],
72 [ACTION-IF-NOT-FOUND])
73 Retrieves the value of the pkg-config variable CONFIG-VARIABLE from
74 MODULE and stores it in the VARIABLE variable.
75
76 Note that repeated usage of VARIABLE is not recommended as the check will
77 be skipped if the variable is already set.
78
79 PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],[ACTION-IF-
80 NOT-FOUND], [DESCRIPTION], [DEFAULT])
81 Prepares a "--with-" configure option using the lowercase VARIABLE-PREFIX
82 name, merging the behaviour of AC_ARG_WITH and PKG_CHECK_MODULES in a
83 single macro.
84
85 PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, [DESCRIPTION], [DEFAULT])
86 Convenience macro to trigger AM_CONDITIONAL after a PKG_WITH_MODULES
87 check. VARIABLE-PREFIX is exported as a make variable.
88
89 PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, [DESCRIPTION],
90 [DEFAULT])
91 Convenience macro to trigger AM_CONDITIONAL and AC_DEFINE after a
92 PKG_WITH_MODULES check. VARIABLE-PREFIX is exported as a make variable.
93
94BSD December 5, 2017 BSD