Preparation for GnuTLS backend
authorFelix Morgner <felix.morgner@gmail.com>
Wed, 23 Apr 2014 13:31:08 +0000 (15:31 +0200)
committerFelix Morgner <felix.morgner@gmail.com>
Wed, 23 Apr 2014 13:31:08 +0000 (15:31 +0200)
I added the necessary lines to the autotools files. Maybe someone
else should look into this as it seems to me like its currently
more of a dirty hack. I works though.

configure.ac
src/Makefile.am
src/ssli_gnutls.c [new file with mode: 0644]

index ff2ddd526d4ab27cad48e28805ac4c10a4b424b6..3fb9757641441aa7106392cd9f90186d295672f2 100644 (file)
@@ -32,7 +32,7 @@
 AC_PREREQ([2.63])
 AC_INIT([umurmur], [0.2.14], [http://code.google.com/p/umurmur/issues/entry], [umurmur], [http://code.google.com/p/umurmur])
 AC_CONFIG_SRCDIR([src/client.h])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([src/config.h])
 AM_INIT_AUTOMAKE
 AC_CANONICAL_HOST
 
@@ -86,6 +86,9 @@ AS_IF([test "x$with_ssl" = xopenssl], [
        AC_CHECK_LIB([ssl], [SSL_library_init], [], [AC_MSG_ERROR([could not find libssl])])
 ])
 
+AM_CONDITIONAL(USE_OPENSSL, test x$with_ssl = xopenssl)
+AM_CONDITIONAL(USE_GNUTLS, test x$with_ssl = xgnutls)
+
 AC_DEFINE([DEFAULT_CONFIG], ["/etc/umurmur.conf"], [Default config])
 
 # Checks for header files.
index 3118dc59cd49042b853336993cf14e14a2c9aae4..912232ef57f6f8e1442e0fbaa761f138ed5b9de6 100644 (file)
 #  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 bin_PROGRAMS=umurmurd
-umurmurd_SOURCES=client.c main.c messages.c pds.c server.c ssl.c log.c conf.c crypt.c timer.c messagehandler.c channel.c Mumble.pb-c.c voicetarget.c ban.c
+umurmurd_SOURCES=client.c main.c messages.c pds.c server.c log.c conf.c crypt.c timer.c messagehandler.c channel.c Mumble.pb-c.c voicetarget.c ban.c
 
+if USE_OPENSSL
+umurmurd_SOURCES+=ssli_openssl.c
+else
+if USE_GNUTLS
+umurmurd_SOURCES+=ssli_gnutls.c
+else
+umurmurd_SOURCES+=ssli_polarssl.c
+endif
+endif
diff --git a/src/ssli_gnutls.c b/src/ssli_gnutls.c
new file mode 100644 (file)
index 0000000..e69de29