Lines Matching +full:pkg +full:- +full:config
1 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2 # serial 12 (pkg-config-0.29.2)
5 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
19 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 dnl 02111-1307, USA.
28 dnl PKG_PREREQ(MIN-VERSION)
29 dnl -----------------------
32 dnl Verify that the version of the pkg-config macros are at least
33 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
34 dnl installed version of pkg-config, this checks the developer's version
35 dnl of pkg.m4 when generating configure.
39 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
45 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
46 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
49 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
50 dnl ----------------------------------
53 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
54 dnl first found in the path. Checks that the version of pkg-config found
55 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
57 dnl pkg-config existed.
59 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
62 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
63 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
64 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
67 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
69 if test -n "$PKG_CONFIG"; then
71 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
72 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
81 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
82 dnl -------------------------------------------------------------------
94 if test -n "$PKG_CONFIG" && \
95 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
102 dnl ---------------------------------------------
103 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
106 [if test -n "$$1"; then
108 elif test -n "$PKG_CONFIG"; then
110 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
119 dnl ---------------------------
120 dnl Internal check to see if pkg-config supports short errors.
123 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
131 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
132 dnl [ACTION-IF-NOT-FOUND])
133 dnl --------------------------------------------------------------
141 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
142 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
151 and $1[]_LIBS to avoid the need to call pkg-config.
152 See the pkg-config man page for more details.])
158 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
160 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
162 # Put the nasty error message in config.log where it belongs
171 installed software in a non-standard prefix.
178 [The pkg-config script could not be found or is too old. Make sure it
180 path to pkg-config.
184 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
195 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
196 dnl [ACTION-IF-NOT-FOUND])
197 dnl ---------------------------------------------------------------------
201 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
202 dnl and VARIABLE-PREFIX_LIBS from --libs.
211 PKG_CONFIG="$PKG_CONFIG --static"
218 dnl -------------------------
222 dnl should install pkg-config .pc files. By default the directory is
224 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
229 [pkg-config installation directory @<:@]pkg_default[@:>@])
231 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
240 dnl --------------------------------
244 dnl module should install arch-independent pkg-config .pc files. By
247 dnl --with-noarch-pkgconfigdir parameter.
251 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
252 AC_ARG_WITH([noarch-pkgconfigdir],
253 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
261 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
262 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
263 dnl -------------------------------------------
266 dnl Retrieves the value of the pkg-config variable for the given module.
269 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl