m4: add AG_GST_PKG_CONFIG_PATH macro
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 14 Aug 2010 17:59:23 +0000 (18:59 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 14 Aug 2010 17:59:23 +0000 (18:59 +0100)
Sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am
which contains the path of the in-tree pkgconfig directory first
and then any paths specified in PKG_CONFIG_PATH.

We do this mostly so we don't have to use unportable shell constructs
such as ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} in Makefile.am to handle
the case where the environment variable is not set, but also in order
to avoid a trailing ':' in the PKG_CONFIG_PATH which apparently causes
problems with pkg-config on windows with msys/mingw.

Also shows the PKG_CONFIG_PATH set up in the configure output,
which is handy when debugging other people's configure problems.

m4/gst.m4

index 04b466f..ddfde51 100644 (file)
--- a/m4/gst.m4
+++ b/m4/gst.m4
@@ -8,3 +8,24 @@ AC_DEFUN([AG_GST_INIT],
 [
   m4_pattern_forbid(^_?AG_GST_)
 ])
+
+dnl AG_GST_PKG_CONFIG_PATH
+dnl
+dnl sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am
+dnl which contains the path of the in-tree pkgconfig directory first
+dnl and then any paths specified in PKG_CONFIG_PATH.
+dnl
+dnl We do this mostly so we don't have to use unportable shell constructs
+dnl such as ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} in Makefile.am to handle
+dnl the case where the environment variable is not set, but also in order
+dnl to avoid a trailing ':' in the PKG_CONFIG_PATH which apparently causes
+dnl problems with pkg-config on windows with msys/mingw.
+AC_DEFUN([AG_GST_PKG_CONFIG_PATH],
+[
+  GST_PKG_CONFIG_PATH="\$(top_builddir)/pkgconfig"
+  if test "x$PKG_CONFIG_PATH" != "x"; then
+    GST_PKG_CONFIG_PATH="$GST_PKG_CONFIG_PATH:$PKG_CONFIG_PATH"
+  fi
+  AC_SUBST([GST_PKG_CONFIG_PATH])
+  AC_MSG_NOTICE([Using GST_PKG_CONFIG_PATH = $GST_PKG_CONFIG_PATH])
+])