Commit 46fd481b authored by Philip Withnall's avatar Philip Withnall Committed by Olivier Crête

nice: Auto-substitute pkg-config requirements in nice.pc.in

The requirements in the pkg-config file were outdated and incomplete. It
makes a lot more sense to automatically substitute them in from the
checks in configure.ac.
parent 44c0b98c
......@@ -181,12 +181,15 @@ AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"], [LIBRT=""])
AC_CHECK_FUNCS([poll])
AC_SUBST(LIBRT)
PKG_CHECK_MODULES(GLIB, [dnl
glib-2.0 >= $GLIB_REQ dnl
gobject-2.0 >= $GLIB_REQ dnl
gthread-2.0 >= $GLIB_REQ dnl
gio-2.0 >= $GLIB_REQ dnl
])
# Dependencies
NICE_PACKAGES_PUBLIC="glib-2.0 >= $GLIB_REQ gio-2.0 >= $GLIB_REQ gobject-2.0 >= $GLIB_REQ"
NICE_PACKAGES_PRIVATE="gthread-2.0"
NICE_PACKAGES="$NICE_PACKAGES_PUBLIC $NICE_PACKAGES_PRIVATE"
AC_SUBST([NICE_PACKAGES_PUBLIC])
AC_SUBST([NICE_PACKAGES_PRIVATE])
AC_SUBST([NICE_PACKAGES])
PKG_CHECK_MODULES(GLIB, [$NICE_PACKAGES])
AC_ARG_WITH(gstreamer,
AS_HELP_STRING([--with-gstreamer],[build GStreamer plugin]),
......@@ -255,9 +258,13 @@ AC_ARG_ENABLE([gupnp],
esac],
WANT_GUPNP=test)
GUPNP_PACKAGES_PUBLIC=""
GUPNP_PACKAGES_PRIVATE="gupnp-igd-1.0 >= $GUPNP_IGD_REQUIRED"
GUPNP_PACKAGES="$GUPNP_PACKAGES_PUBLIC $GUPNP_PACKAGES_PRIVATE"
HAVE_GUPNP=no
if test "x$WANT_GUPNP" != "xno"; then
PKG_CHECK_MODULES(GUPNP, gupnp-igd-1.0 >= $GUPNP_IGD_REQUIRED,
PKG_CHECK_MODULES(GUPNP, [$GUPNP_PACKAGES],
[ HAVE_GUPNP=yes ],
[ HAVE_GUPNP=no ])
fi
......@@ -267,8 +274,16 @@ fi
if test "x$HAVE_GUPNP" = "xyes"; then
AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])
else
GUPNP_PACKAGES_PUBLIC=""
GUPNP_PACKAGES_PRIVATE=""
GUPNP_PACKAGES=""
fi
AC_SUBST([GUPNP_PACKAGES_PUBLIC])
AC_SUBST([GUPNP_PACKAGES_PRIVATE])
AC_SUBST([GUPNP_PACKAGES])
AC_SUBST(HAVE_GUPNP)
dnl Test coverage
......
......@@ -5,9 +5,8 @@ includedir=@includedir@
Name: libnice
Description: ICE library
Requires: glib-2.0 >= 2.10.0
Version: @VERSION@
Libs: -L${libdir} -lnice @GLIB_LIBS@
Libs.private: @GUPNP_LIBS@
Cflags: @GLIB_CFLAGS@ -I${includedir} -I${includedir}/nice
Requires: @NICE_PACKAGES_PUBLIC@ @GUPNP_PACKAGES_PUBLIC@
Requires.private: @NICE_PACKAGES_PRIVATE@ @GUPNP_PACKAGES_PRIVATE@
Libs: -L${libdir} -lnice
Cflags: -I${includedir}/nice
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment