From 7c32c84d0eafb442746999670b7ba7ab8d62bcb8 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 7 Sep 2009 18:10:49 +0200 Subject: [PATCH] removed conditional sources from Makefile.inc added ifdef blocks to libgcrypt.c, pem.c, openssl.c --- Makefile.inc | 8 +------- src/libgcrypt.c | 5 +++++ src/openssl.c | 5 +++++ src/pem.c | 4 ++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index 658b1d6..53e7a51 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,11 +1,5 @@ CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \ packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \ - version.c knownhost.c - -ifdef LIBGCRYPT -CSOURCES += libgcrypt.c pem.c -else -CSOURCES += openssl.c -endif + version.c knownhost.c openssl.c libgcrypt.c pem.c HHEADERS = libssh2_priv.h openssl.h libgcrypt.h transport.h channel.h comp.h mac.h misc.h diff --git a/src/libgcrypt.c b/src/libgcrypt.c index 4e79396..f1c3cbd 100644 --- a/src/libgcrypt.c +++ b/src/libgcrypt.c @@ -37,6 +37,9 @@ */ #include "libssh2_priv.h" + +#ifdef LIBSSH2_LIBGCRYPT /* compile only if we build with libgcrypt */ + #include int @@ -572,3 +575,5 @@ _libssh2_cipher_crypt(_libssh2_cipher_ctx * ctx, } return ret; } + +#endif /* LIBSSH2_LIBGCRYPT */ diff --git a/src/openssl.c b/src/openssl.c index 1fc00ca..2fa356f 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -37,6 +37,9 @@ */ #include "libssh2_priv.h" + +#ifndef LIBSSH2_LIBGCRYPT /* compile only if we build with OpenSSL */ + #include #ifndef EVP_MAX_BLOCK_LENGTH @@ -337,3 +340,5 @@ _libssh2_dsa_sha1_sign(libssh2_dsa_ctx * dsactx, return 0; } + +#endif /* !LIBSSH2_LIBGCRYPT */ diff --git a/src/pem.c b/src/pem.c index 9059477..5749bc8 100644 --- a/src/pem.c +++ b/src/pem.c @@ -38,6 +38,8 @@ #include "libssh2_priv.h" +#ifdef LIBSSH2_LIBGCRYPT /* compile only if we build with libgcrypt */ + static int readline(char *line, int line_size, FILE * fp) { @@ -207,3 +209,5 @@ _libssh2_pem_decode_integer(unsigned char **data, unsigned int *datalen, return 0; } + +#endif /* LIBSSH2_LIBGCRYPT */