Peter Stuge wrote: > Or I can commit the fix on top of what is currently there.
Here's what that would look like. //Peter
>From faf0cf6553cb7fed9c5af709c0f1b2cb02f290a9 Mon Sep 17 00:00:00 2001 From: Peter Stuge <pe...@stuge.se> Date: Wed, 18 Sep 2013 09:28:40 +0200 Subject: [PATCH] Move automake conditionals added by commit d512b25f out of Makefile.inc Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 added automake conditionals to Makefile.inc but since Makefile.inc is included by all other build systems that will not work. This commit instead creates Makefile.OpenSSL.inc and Makefile.libgcrypt.inc and moves the automake conditional to src/Makefile.am where it belongs. The conditional code includes the correct Makefile.$name.inc according to crypto library selection/detection by the configure script. All build files in libssh2 for other build systems are hardcoded to use OpenSSL, so no conditionals are needed there. --- Makefile.OpenSSL.inc | 2 ++ Makefile.am | 2 ++ Makefile.inc | 18 +++--------------- Makefile.libgcrypt.inc | 2 ++ NMakefile | 2 ++ nw/GNUmakefile | 3 +++ src/Makefile.am | 8 ++++++++ win32/GNUmakefile | 3 +++ win32/Makefile.Watcom | 2 ++ 9 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 Makefile.OpenSSL.inc create mode 100644 Makefile.libgcrypt.inc diff --git a/Makefile.OpenSSL.inc b/Makefile.OpenSSL.inc new file mode 100644 index 0000000..76f3e85 --- /dev/null +++ b/Makefile.OpenSSL.inc @@ -0,0 +1,2 @@ +CRYPTO_CSOURCES = openssl.c +CRYPTO_HHEADERS = openssl.h diff --git a/Makefile.am b/Makefile.am index 023200d..e0a74c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,6 +75,8 @@ gen-coverage: coverage: init-coverage build-coverage gen-coverage # DSP/VCPROJ generation adapted from libcurl +# only OpenSSL is supported with this build system +include Makefile.OpenSSL.inc # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc diff --git a/Makefile.inc b/Makefile.inc index b2e0f78..8f2e570 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,18 +1,6 @@ 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 agent.c pem.c keepalive.c global.c -if OPENSSL -CSOURCES += openssl.c -endif -if LIBGCRYPT -CSOURCES += libgcrypt.c -endif + version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c -HHEADERS = libssh2_priv.h transport.h channel.h comp.h mac.h misc.h \ - packet.h userauth.h session.h sftp.h crypto.h -if OPENSSL -HHEADERS += openssl.h -endif -if LIBGCRYPT -HHEADERS += libgcrypt.h -endif +HHEADERS = libssh2_priv.h $(CRYPTO_HHEADERS) transport.h channel.h comp.h \ + mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h diff --git a/Makefile.libgcrypt.inc b/Makefile.libgcrypt.inc new file mode 100644 index 0000000..5d56292 --- /dev/null +++ b/Makefile.libgcrypt.inc @@ -0,0 +1,2 @@ +CRYPTO_CSOURCES = libgcrypt.c +CRYPTO_HHEADERS = libgcrypt.h diff --git a/NMakefile b/NMakefile index f3fcce1..b15fd2e 100644 --- a/NMakefile +++ b/NMakefile @@ -1,5 +1,7 @@ !include "win32/config.mk" +# only OpenSSL is supported with this build system +!include "Makefile.OpenSSL.inc" !include "Makefile.inc" OBJECTS=$(CSOURCES:.c=.obj) diff --git a/nw/GNUmakefile b/nw/GNUmakefile index 2e24c88..e666e29 100644 --- a/nw/GNUmakefile +++ b/nw/GNUmakefile @@ -213,6 +213,9 @@ endif vpath %.c . ../src +# only OpenSSL is supported with this build system +include ../Makefile.OpenSSL.inc + # include Makefile.inc to get CSOURCES define include ../Makefile.inc diff --git a/src/Makefile.am b/src/Makefile.am index 53fb4e8..da7beb5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,14 @@ # $Id: Makefile.am,v 1.21 2009/05/07 17:21:56 bagder Exp $ AUTOMAKE_OPTIONS = foreign nostdinc +# Get the CRYPTO_CSOURCES and CRYPTO_HHEADERS defines +if OPENSSL +include ../Makefile.OpenSSL.inc +endif +if LIBGCRYPT +include ../Makefile.libgcrypt.inc +endif + # Makefile.inc provides the CSOURCES and HHEADERS defines include ../Makefile.inc diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 5dcd3c8..c0cc20a 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -179,6 +179,9 @@ CFLAGS += $(INCLUDES) vpath %.c . ../src +# only OpenSSL is supported with this build system +include ../Makefile.OpenSSL.inc + # include Makefile.inc to get CSOURCES define include ../Makefile.inc diff --git a/win32/Makefile.Watcom b/win32/Makefile.Watcom index 3393ad4..5847cf7 100644 --- a/win32/Makefile.Watcom +++ b/win32/Makefile.Watcom @@ -93,6 +93,8 @@ LIB_ARG = $(OBJ_BASE)\stat\wlib.arg !ifndef %MAKEFLAGS !error You MUST call wmake with the -u switch! !else +# only OpenSSL is supported with this build system +!include ..\Makefile.OpenSSL.inc !include ..\Makefile.inc !endif -- 1.8.1.rc0.2.gfb4c622.dirty
_______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel