Check crypto library availability by type
This commit is contained in:
parent
e44f59f2b3
commit
50843f0b85
15
configure.ac
15
configure.ac
|
@ -159,9 +159,6 @@ if test "x${TCLLIBDIR+set}" != "xset" ; then
|
|||
TCLLIBDIR="${TCLLIBDIR}/sqlite3"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([crypto], [HMAC_Init_ex], ,
|
||||
AC_MSG_ERROR([Library crypto not found. Install openssl!"]))
|
||||
|
||||
#########
|
||||
# Set up an appropriate program prefix
|
||||
#
|
||||
|
@ -260,14 +257,18 @@ AC_ARG_WITH([crypto-lib],
|
|||
AC_HELP_STRING([--with-crypto-lib],[Specify which crypto library to use]),
|
||||
crypto_lib=$withval)
|
||||
AC_MSG_CHECKING([for crypto library to use])
|
||||
if test "$crypto_lib" = "libtomcrypto"; then
|
||||
CFLAGS+=" -DSQLCIPHER_CRYPTO_LIBTOMCRYPTO"
|
||||
BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_LIBTOMCRYPTO"
|
||||
AC_MSG_RESULT([libtomcrypto])
|
||||
if test "$crypto_lib" = "libtomcrypt"; then
|
||||
CFLAGS+=" -DSQLCIPHER_CRYPTO_LIBTOMCRYPT"
|
||||
BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_LIBTOMCRYPT"
|
||||
AC_MSG_RESULT([libtomcrypt])
|
||||
AC_CHECK_LIB([tomcrypt], [register_cipher], ,
|
||||
AC_MSG_ERROR([Library crypto not found. Install libtomcrypt!"]))
|
||||
else
|
||||
CFLAGS+=" -DSQLCIPHER_CRYPTO_OPENSSL"
|
||||
BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_OPENSSL"
|
||||
AC_MSG_RESULT([openssl])
|
||||
AC_CHECK_LIB([crypto], [HMAC_Init_ex], ,
|
||||
AC_MSG_ERROR([Library crypto not found. Install openssl!"]))
|
||||
fi
|
||||
|
||||
##########
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef SQLCIPHER_CRYPTO_LIBTOMCRYPTO
|
||||
#ifdef SQLCIPHER_CRYPTO_LIBTOMCRYPT
|
||||
#include <tomcrypt.h>
|
||||
|
||||
void sqlcipher_activate(void *ctx) {
|
||||
|
|
Loading…
Reference in New Issue