[gnutls-dev] Autoconf tests for GNUTLS?

Simon Josefsson jas at extundo.com
Fri Nov 23 20:49:01 CET 2001


Has anyone written a autoconf test for detecting GNUTLS?

I am now using the following, if someone would like to pick this up
and turn it into a proper AC_DEFUN or whatever, that would be nice.

### Use GnuTLS if available
HAVE_GNUTLS=no
AC_ARG_WITH(gnutls,
          [  --with-gnutls[=DIR]       use GNU TLS installed with prefix DIR],
          libgnutls_config="$withval", libgnutls_config="")

  if test x$libgnutls_config != x ; then
     libgnutls_config_args="$libgnutls_config_args --prefix=$libgnutls_config"
     if test x${LIBGNUTLS_CONFIG+set} != xset ; then
        LIBGNUTLS_CONFIG=$libgnutls_config/bin/libgnutls-config
     fi
  fi
AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
if test "$LIBGNUTLS_CONFIG" != "no" ; then
  LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
  LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
  HAVE_GNUTLS=yes
  AC_SUBST(LIBGNUTLS_CFLAGS)
  AC_SUBST(LIBGNUTLS_LIBS)
  AC_DEFINE(HAVE_GNUTLS)
fi





More information about the Gnutls-devel mailing list