From 5610bfab7fe9910823f05dc17d453271106047b1 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 2 Sep 2010 07:31:54 +0200 Subject: [PATCH] add libssl stuff to autotools stuff --- Makefile.am | 9 +++++++-- configure.ac | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 31a92be..acd3bcb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,8 +10,13 @@ lib_LTLIBRARIES = libd0_blind_id.la # - incompatible interface change: c:r:a -> c+1:0:0 # - internal change: c:r:a -> c:r+1:a -libd0_blind_id_la_SOURCES = d0_bignum-gmp.c d0_blind_id.c d0.c d0_iobuf.c sha2.c \ - d0_bignum-gmp.h d0_blind_id.h d0.h d0_iobuf.h sha2.h +libd0_blind_id_la_SOURCES = d0_blind_id.c d0.c d0_iobuf.c sha2.c \ + d0_blind_id.h d0.h d0_iobuf.h sha2.h +if WITH_OPENSSL +libd0_blind_id_la_SOURCES += d0_bignum-openssl.c d0_bignum-openssl.h +else +libd0_blind_id_la_SOURCES += d0_bignum-gmp.c d0_bignum-gmp.h +endif libd0_blind_id_la_LDFLAGS = -versioninfo 3:0:3 libd0_blind_id_la_CFLAGS = -fvisibility=hidden -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement library_includedir = $(includedir)/d0_blind_id diff --git a/configure.ac b/configure.ac index 50ee280..ce36408 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,15 @@ AM_INIT_AUTOMAKE([-Wall foreign]) AC_PROG_CC AC_PROG_LIBTOOL -AC_SEARCH_LIBS(__gmpz_init, gmp, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/])]) +AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl], [Use OpenSSL instead of GMP (beware of the OpenSSL license)]), [enable_openssl=$enableval], [enable_openssl=no]) +AM_CONDITIONAL(ENABLE_OPENSSL, [test x$enable_openssl = xyes]) + +if test x$enable_openssl = xyes +then + AC_SEARCH_LIBS(BN_init, ssl, , [AC_MSG_ERROR([OpenSSL not found, see http://www.openssl.org/, or try --without-openssl])]) +else + AC_SEARCH_LIBS(__gmpz_init, gmp, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/, or try --with-openssl])]) +fi AC_ARG_ENABLE(rijndael, AS_HELP_STRING([--disable-rijndael], [Disable build of the d0_rijndael library]), [enable_aes=$enableval], [enable_aes=yes]) AM_CONDITIONAL(ENABLE_RIJNDAEL, [test x$enable_aes = xyes]) -- 2.39.2