From 7bbd34d95097b8c83fe6a90b250dbb8d576c6359 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 4 Jan 2016 19:11:37 +1100 Subject: [PATCH] Clean up autofoo magic to search for proper functions to include libraries as needed without extra variables --- configure.ac | 23 +++++++++++------------ src/Makefile.am | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 25e8824d..f452a9a6 100644 --- a/configure.ac +++ b/configure.ac @@ -79,27 +79,29 @@ AC_ARG_WITH([ckdb], [ckdb=$withval] ) -#AC_SEARCH_LIBS(whatgoeshere?, rt, , echo "Error: Required library realtime not found." && exit 1) AC_SEARCH_LIBS(exp, m, , echo "Error: Required library math not found." && exit 1) AC_SEARCH_LIBS(pthread_mutex_trylock, pthread, , "Error: Required library pthreads not found." && exit 1) if test "x$ckdb" != "xno"; then - AC_CHECK_LIB([pq], [main],[PQ=-lpq],echo "Error: Required library pq + AC_SEARCH_LIBS(PQdb, pq, , echo "Error: Required library pq not found. Install it or disable postgresql support with --without-ckdb" && exit 1) - AC_CHECK_LIB([gsl], [main],[GSL=-lgsl],echo "Error: Required libraries gsl and gslcblas - not found. Install them or disable support with --without-ckdb" && exit 1,[-lgslcblas]) - AC_CHECK_LIB([ssl], [main],[SSL=-lssl],echo "Error: Required libraries ssl and crypto - not found. Install them or disable support with --without-ckdb" && exit 1,[-lcrypto]) + AC_SEARCH_LIBS(BN_init, crypto, , echo "Error: Required library crypto + not found. Install them or disable support with --without-ckdb" && exit 1) + AC_SEARCH_LIBS(SSL_accept, ssl, , echo "Error: Required libraries ssl + not found. Install them or disable support with --without-ckdb" && exit 1) + AC_SEARCH_LIBS(cblas_dgemm, gslcblas, ,echo "Error: Required library gslcblas + not found. Install them or disable support with --without-ckdb" && exit 1) + AC_SEARCH_LIBS(gsl_blas_dgemm, gsl, , echo "Error: Required library gsl + not found. Install them or disable support with --without-ckdb" && exit 1) AC_DEFINE([USE_CKDB], [1], [Defined to 1 if ckdb support required]) - DB_LIBS="-lpq -lgsl -lgslcblas -lssl -lcrypto" -else - DB_LIBS="" fi AM_CONDITIONAL([WANT_CKDB], [test "x$ckdb" != "xno"]) AC_SUBST(DB_LIBS) AC_OUTPUT([Makefile] [src/Makefile]) +LDFLAGS="${LDFLAGS} -Wl,--as-needed" + echo echo "Compilation............: make (or gmake)" echo " YASM (Intel ASM).....: $YASM" @@ -107,9 +109,6 @@ echo " CPPFLAGS.............: $CPPFLAGS" echo " CFLAGS...............: $CFLAGS" echo " LDFLAGS..............: $LDFLAGS" echo " LDADD................: $LIBS $JANSSON_LIBS" -if test "x$ckdb" != "xno"; then - echo " db LDADD.............: $LIBS $DB_LIBS $JANSSON_LIBS" -fi echo echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')" echo " prefix...............: $prefix" diff --git a/src/Makefile.am b/src/Makefile.am index b772eb5b..5ff405ef 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -38,5 +38,5 @@ if WANT_CKDB bin_PROGRAMS += ckdb ckdb_SOURCES = ckdb.c ckdb_cmd.c ckdb_data.c ckdb_dbio.c ckdb_btc.c \ ckdb_crypt.c ckdb.h klist.c ktree.c klist.h ktree.h -ckdb_LDADD = libckpool.a @JANSSON_LIBS@ @DB_LIBS@ @LIBS@ $(native_objs) +ckdb_LDADD = libckpool.a @JANSSON_LIBS@ @LIBS@ endif