aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDRC <dcommander@users.sourceforge.net>2010-10-01 09:31:18 +0000
committerDRC <dcommander@users.sourceforge.net>2010-10-01 09:31:18 +0000
commitf79eb27b5301214b506f2de1caf6c5109772dc01 (patch)
tree0f0c2c4d1991684c3ab79d7863958f9604457855
parentbfd66c1e8c526dff1757bf349c9bb4d87906265f (diff)
downloadtigervnc-f79eb27b5301214b506f2de1caf6c5109772dc01.tar.gz
tigervnc-f79eb27b5301214b506f2de1caf6c5109772dc01.zip
Add GNUTLS_CFLAGS and GNUTLS_LDFLAGS to allow GnuTLS compile/link arguments to be customized (for instance, to force building against the static libraries)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4157 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--configure.ac28
1 files changed, 21 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index a5ebbff6..560f5fc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,15 +73,29 @@ AC_ARG_ENABLE([gnutls],
AS_HELP_STRING([--enable-gnutls],
[build in GNUTLS based encryption support (default yes)]),
[enable_gnutls="$enableval"], [enable_gnutls=yes])
+AC_ARG_VAR(GNUTLS_CFLAGS, [Custom C compiler flags for using GnuTLS, e.g. -I{GnuTLS directory}/include])
+AC_ARG_VAR(GNUTLS_LDFLAGS, [Custom linker flags for using GnuTLS, e.g. -L{GnuTLS directory}/lib -lgnutls])
+
GNUTLS_LIBS=
if test "x$enable_gnutls" = xyes; then
- AC_CHECK_LIB([gnutls], [gnutls_global_init],
- [GNUTLS_LIBS='-lgnutls -lgcrypt -lgpg-error'
- AC_DEFINE([HAVE_GNUTLS], 1, [Is gnutls present? ])], [],
- [-lgcrypt -lgpg-error])
- AC_CHECK_LIB([gnutls], [gnutls_transport_set_global_errno], [],
- [AC_DEFINE([HAVE_OLD_GNUTLS], 1, [Does gnutls lack the gnutls_transport_set_global_errno() function? ])],
- [-lgcrypt -lgpg-error])
+ if test "x$GNUTLS_LDFLAGS" = "x"; then
+ GNUTLS_LDFLAGS='-lgnutls -lgcrypt -lgpg-error'
+ fi
+ SAVE_LIBS=${LIBS}
+ LIBS="${LIBS} ${GNUTLS_LDFLAGS}"
+ SAVE_CPPFLAGS=${CPPFLAGS}
+ CPPFLAGS="${CPPFLAGS} ${GNUTLS_CFLAGS}"
+ AC_MSG_CHECKING([for GnuTLS library])
+ AC_LINK_IFELSE(AC_LANG_CALL([], gnutls_global_init),
+ [GNUTLS_LIBS=${GNUTLS_LDFLAGS}
+ AC_DEFINE(HAVE_GNUTLS, 1, [Is gnutls present? ])
+ AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
+ AC_MSG_CHECKING([for gnutls_transport_set_global_errno() function])
+ AC_LINK_IFELSE(AC_LANG_CALL([], gnutls_transport_set_global_errno),
+ AC_MSG_RESULT(yes),
+ [AC_DEFINE(HAVE_OLD_GNUTLS, 1, [Does gnutls lack the gnutls_transport_set_global_errno() function? ])
+ AC_MSG_RESULT(no)])
+ LIBS=${SAVE_LIBS}
fi
AC_SUBST([GNUTLS_LIBS])
AM_CONDITIONAL([HAVE_GNUTLS], [ ! test "x$GNUTLS_LIBS" = x ])