From a2170f0763d498a1822533278eb8c25ad60d3bdc Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Tue, 7 Jun 2016 15:36:48 +0300 Subject: [PATCH] Compile the cryptopp wrapper only when used This should allow us to avoid an unnecessary dependancy to a C++ compiler. Conflicts: configure.ac --- configure.ac | 1 + src/Makefile.am | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0a26ede3..bf4341e9 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,7 @@ AS_IF([test "x$with_cryptopp" = "xyes"], [ ) ]) +AM_CONDITIONAL([USE_CRYPTOPP], [test "x$with_cryptopp" = "xyes"]) CPPFLAGS="$CPPFLAGS $cryptopp_CFLAGS" LIBS="$LIBS $cryptopp_LIBS" diff --git a/src/Makefile.am b/src/Makefile.am index 6971760f..99312b5c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -132,7 +132,6 @@ libkvazaar_la_SOURCES = \ strategyselector.h \ extras/libmd5.c \ extras/libmd5.h \ - extras/crypto.cpp \ extras/crypto.h libkvazaar_la_CFLAGS = @@ -143,6 +142,17 @@ libkvazaar_la_LIBADD = \ libsse2.la \ libsse41.la +if USE_CRYPTOPP +# The crypto.cpp has to be in it's own library, because otherwise +# autoconf wants to use CXXLD for linking, even if the cpp file +# is not included. +noinst_LTLIBRARIES += libcrypto.la +libkvazaar_la_LIBADD += libcrypto.la +libcrypto_la_SOURCES = \ + extras/crypto.h \ + extras/crypto.cpp +endif + libkvazaar_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-number $(KVZ_API_VERSION)