From 53799ad51ed383147b3dbc812e438ed94ccc8489 Mon Sep 17 00:00:00 2001 From: gpadd Date: Sat, 8 Jun 2013 18:03:35 +0200 Subject: [PATCH] Added a test to check if the user wants gnutls to be supported and if they do, check if they have it installed and otherwise give an error. --- Makefile.am | 7 +++++++ configure.ac | 24 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index cd22377..2c5b89f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,6 +11,13 @@ SOURCES = \ irc/tagged-hook.scm \ irc/irc.scm \ irc/handlers.scm +if GNUTLS +SOURCES += \ + irc/gnutls.scm \ + irc/network.scm +else +SOURCES += +endif info_TEXINFOS = doc/api.texi diff --git a/configure.ac b/configure.ac index 84171f3..86643f0 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(guile-irc, 0.2) AC_CONFIG_SRCDIR(irc/irc.scm) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign]) -AM_SILENT_RULES([yes]) +AM_SILENT_RULES([yes]) GUILE_PROGS @@ -14,11 +14,23 @@ if $GUILE_TOOLS | grep -q compile; then else AC_MSG_ERROR([Guile 2.0 required.]) fi -if gnutls-cli --help | grep -q USAGE:; then - # good, it seems to be installed - true -else - AC_MSG_ERROR([GnuTLS required]) + +AC_ARG_ENABLE([gnutls], + [ --enable-gnutls Turn on gnutls], + [case "${enableval}" in + yes) gnutls=true ;; + no) gnutls=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-gnutls]) ;; + esac],[gnutls=false]) + AM_CONDITIONAL([GNUTLS], [test x$gnutls = xtrue]) + +if $GNUTLS ; then + if gnutls-cli --help | grep -q USAGE:; then + # good, seems to be installed + true + else + AC_MSG_ERROR([GnuTLS required]) + fi fi AC_CONFIG_FILES([Makefile] [doc/Makefile])