stun: Add libgcrypt dependency
authorPhilip Withnall <philip@tecnocode.co.uk>
Mon, 7 Mar 2016 09:27:00 +0000 (09:27 +0000)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Fri, 31 Mar 2017 22:25:07 +0000 (18:25 -0400)
This will shortly be used to implement secure random number generation.

Differential Revision: https://phabricator.freedesktop.org/D1609

README
configure.ac
nice/nice.pc.in
stun/Makefile.am

diff --git a/README b/README
index d3a0d9a..858ea00 100644 (file)
--- a/README
+++ b/README
@@ -20,6 +20,7 @@ Requirements
  pkg-config
  gupnp-igd >= 0.1.2 (optional)
  gstreamer-0.10 >= 0.10.0 (optional)
+ gcrypt >= 1.4.5
 
 Build instructions
 ------------------
index 6be4010..1075610 100644 (file)
@@ -301,6 +301,22 @@ AC_SUBST([GUPNP_PACKAGES])
 AC_SUBST(HAVE_GUPNP)
 AC_SUBST([UPNP_ENABLED])
 
+dnl libgcrypt
+GCRYPT_VERSION=1.4.5
+GCRYPT_LIBVER=1
+
+AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,AC_MSG_ERROR([[
+***
+*** libgcrypt was not found. You may want to get it from
+*** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
+***
+]]))
+libgcrypt=yes
+AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION", [Version of GCRYPT we expect])
+
+AC_SUBST([LIBGCRYPT_CFLAGS])
+AC_SUBST([LIBGCRYPT_LIBS])
+
 dnl Test coverage
 AC_ARG_ENABLE([coverage],
        [AS_HELP_STRING([--enable-coverage],
index 8805f0d..b968ca8 100644 (file)
@@ -10,4 +10,5 @@ Version: @VERSION@
 Requires: @NICE_PACKAGES_PUBLIC@ @GUPNP_PACKAGES_PUBLIC@
 Requires.private: @NICE_PACKAGES_PRIVATE@ @GUPNP_PACKAGES_PRIVATE@
 Libs: -L${libdir} -lnice
+Libs.private: @LIBGCRYPT_LIBS@
 Cflags: -I${includedir}/nice -I${includedir}
index f90c3d4..7645be9 100644 (file)
@@ -10,7 +10,12 @@ SUBDIRS = . tools tests
 
 include $(top_srcdir)/common.mk
 
-AM_CFLAGS = -std=gnu99 -DG_LOG_DOMAIN=\"libnice-stun\" $(LIBNICE_CFLAGS)
+AM_CFLAGS = \
+       -std=gnu99 \
+       -DG_LOG_DOMAIN=\"libnice-stun\" \
+       $(LIBNICE_CFLAGS) \
+       $(LIBGCRYPT_CFLAGS) \
+       $(NULL)
 AM_CPPFLAGS = -I$(top_srcdir)
 
 if WINDOWS
@@ -35,7 +40,7 @@ libstun_la_SOURCES = constants.h \
        usages/turn.c usages/turn.h \
        usages/timer.c usages/timer.h
 
-libstun_la_LIBADD = $(LIBRT)
+libstun_la_LIBADD = $(LIBRT) $(LIBGCRYPT_LIBS)
 
 EXTRA_DIST = win32_common.h