From f79eb27b5301214b506f2de1caf6c5109772dc01 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 1 Oct 2010 09:31:18 +0000 Subject: [PATCH] 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 --- configure.ac | 28 +++++++++++++++++++++------- 1 file 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 ]) -- 2.39.5