Move automake conditionals added by commit d512b25f out of Makefile.inc

Commit d512b25f69 added automake
conditionals to Makefile.inc but since Makefile.inc is included
from Makefile for all other build systems that does not work.

This commit instead adds Makefile.OpenSSL.inc and Makefile.libgcrypt.inc
and moves the automake conditional to its proper place, src/Makefile.am.

The automake conditional includes the correct Makefile.$name.inc per
the crypto library selection/detection done by configure.

All non-autotools build system files in libssh2 are hardcoded to use
OpenSSL and do not get a conditional but at least there is some reuse
because they can all include the new Makefile.OpenSSL.inc.
This commit is contained in:
Peter Stuge 2013-09-18 09:28:40 +02:00
parent 85a827d1bc
commit f5c1a0d98b
9 changed files with 27 additions and 15 deletions

2
Makefile.OpenSSL.inc Normal file
View File

@ -0,0 +1,2 @@
CRYPTO_CSOURCES = openssl.c
CRYPTO_HHEADERS = openssl.h

View File

@ -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

View File

@ -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

2
Makefile.libgcrypt.inc Normal file
View File

@ -0,0 +1,2 @@
CRYPTO_CSOURCES = libgcrypt.c
CRYPTO_HHEADERS = libgcrypt.h

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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