summaryrefslogtreecommitdiff
path: root/macros2/gnome-pkgconfig.m4
blob: 94a3ad55e10733a8abb6a2a0d768e8c6532b0a3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
dnl
dnl GNOME_CHECK_PKGCONFIG (script-if-enabled, [failflag])
dnl
AC_DEFUN([GNOME_CHECK_PKGCONFIG],[
	AC_PATH_PROG(PKG_CONFIG, pkg-config)
	have_pkgconfig=no
	if test -x "$PKG_CONFIG" ; then
	    have_pkgconfig=yes
	else
	    PKG_CONFIG=
	fi
	AC_MSG_CHECKING(for pkg-config)
	pkgconfig_required_version=0.8.0
	if test x$have_pkgconfig = xyes ; then
	    $PKG_CONFIG --atleast-pkgconfig-version $pkgconfig_required_version
	    if test $? -ne 0; then
		echo "*** Your version of pkg-config is too old. You need version $pkgconfig_required_version or newer."
		echo "*** See http://www.freedesktop.org/software/pkgconfig"
		have_pkgconfig=no
	    fi
	fi
	if test x$have_pkgconfig = xyes ; then
	    AC_MSG_RESULT(yes)
	else
	    PKG_CONFIG=
	    AC_MSG_RESULT(not found)
 	    if test x$2 = xfail; then
		AC_MSG_ERROR([
*** You need the latest pkg-config (at least $pkgconfig_required_version).
*** Get the latest version of pkg-config from
*** http://www.freedesktop.org/software/pkgconfig.])
	    fi
	fi
	AC_SUBST(PKG_CONFIG)

	AC_PROVIDE([GNOME_REQUIRE_PKGCONFIG])
])

dnl
dnl GNOME_REQUIRE_PKGCONFIG
dnl
AC_DEFUN([GNOME_REQUIRE_PKGCONFIG],[
	GNOME_CHECK_PKGCONFIG([], fail)
])