summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Aker <brian@tangent.org>2013-11-21 06:01:39 -0500
committerBrian Aker <brian@tangent.org>2013-11-21 06:01:39 -0500
commitf5fae22c45112ad6bd21a85f0dc85a963f46b094 (patch)
tree7ed36557cc95a222ed1531490962db1cda21112f
parent6b056c58a4ba49455842e7b85dbd60b60e0e963f (diff)
downloadlibmemcached-f5fae22c45112ad6bd21a85f0dc85a963f46b094.tar.gz
Clean up some library usage.
-rw-r--r--configure.ac8
-rw-r--r--libmemcached/include.am4
-rw-r--r--libtest/include.am4
-rw-r--r--m4/ax_check_library.m43
-rw-r--r--m4/ax_dlopen.m410
-rw-r--r--tests/include.am4
6 files changed, 11 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index 54177ac4..696f9bae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,10 +47,13 @@ AX_HEX_VERSION([LIBHASHKIT],[1.0.0])
m4_include([libhashkit/include.m4])
LT_PREREQ([2.2])
-LT_INIT
+LT_INIT([dlopen])
LT_LANG([C++])
LT_LIB_M
+AC_SUBST([lt_cv_dlopen_libs])
+
+
AC_PROG_CC_C99
AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
@@ -254,9 +257,6 @@ AC_CHECK_LIB([rt],[clock_gettime],
[AC_DEFINE([HAVE_CLOCK_GETTIME],[0],[Have clock_gettime])])
-# Check for the ability to call dlopen (used in libhostile)
-AX_DLOPEN
-
AC_CHECK_HEADERS([atomic.h])
AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],
[AC_CHECK_FUNCS([atomic_add_64])
diff --git a/libmemcached/include.am b/libmemcached/include.am
index 4c9af213..1eccc369 100644
--- a/libmemcached/include.am
+++ b/libmemcached/include.am
@@ -125,13 +125,13 @@ libmemcached_libmemcached_la_SOURCES+= libmemcached/virtual_bucket.c
libmemcached/options.cc: libmemcached/csl/parser.h
libmemcached_libmemcached_la_LDFLAGS+= -version-info ${MEMCACHED_LIBRARY_VERSION}
-libmemcached_libmemcached_la_LIBADD+= @DL_LIB@
+libmemcached_libmemcached_la_LIBADD+= @lt_cv_dlopen_libs@
if HAVE_SASL
libmemcached_libmemcached_la_CFLAGS+= @PTHREAD_CFLAGS@
libmemcached_libmemcached_la_CXXFLAGS+= @PTHREAD_CFLAGS@
libmemcached_libmemcached_la_LIBADD+= @PTHREAD_LIBS@
-libmemcached_libmemcached_la_LIBADD+= @LIBSASL_LIB@
+libmemcached_libmemcached_la_LIBADD+= @SASL_LIB@
endif
if HAVE_DTRACE
diff --git a/libtest/include.am b/libtest/include.am
index 4d1d8428..27682be2 100644
--- a/libtest/include.am
+++ b/libtest/include.am
@@ -170,8 +170,10 @@ libtest_libtest_la_LDFLAGS=
# We are either building in tree, or with
libtest_libtest_la_SOURCES+= libtest/memcached.cc
+if HAVE_LIBDRIZZLE
libtest_libtest_la_LDFLAGS+= @LIBDRIZZLE_LDFLAGS@
libtest_libtest_la_LIBADD+= @LIBDRIZZLE_LIB@
+endif
libtest_libtest_la_SOURCES+= libtest/gearmand.cc
@@ -244,7 +246,7 @@ libtest_backtrace_SOURCES=
libtest_backtrace_LDADD=
libtest_backtrace_SOURCES+= libtest/backtrace_test.cc
libtest_backtrace_SOURCES+= libmemcached/backtrace.cc
-libtest_backtrace_LDADD+= @DL_LIB@
+libtest_backtrace_LDADD+= @lt_cv_dlopen_libs@
noinst_PROGRAMS+= libtest/backtrace
test-backtrace: libtest/backtrace
@libtest/backtrace
diff --git a/m4/ax_check_library.m4 b/m4/ax_check_library.m4
index dd27ff41..35ab7114 100644
--- a/m4/ax_check_library.m4
+++ b/m4/ax_check_library.m4
@@ -87,9 +87,6 @@ AC_DEFUN([AX_CHECK_LIBRARY],
AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"],
[AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found])
- AC_SUBST($1[_CPPFLAGS])
- AC_SUBST($1[_LDFLAGS])
- AC_SUBST($1[_LIB],[-l]$3)
ifelse([$4], , :, [$4])],
[ifelse([$5], , :, [$5])])
])
diff --git a/m4/ax_dlopen.m4 b/m4/ax_dlopen.m4
deleted file mode 100644
index 514c578a..00000000
--- a/m4/ax_dlopen.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-#serial 2
-
-AC_DEFUN([AX_DLOPEN],
- [AS_IF([test "x$enable_shared" = xyes],
- [AX_CHECK_LIBRARY([DL],[dlfcn.h],[dl],
- [AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])
- AC_CHECK_LIB([dl],[dlopen],[AC_DEFINE([HAVE_DLOPEN],[1],[Have dlopen])])
- AC_CHECK_LIB([dl],[dladdr],[AC_DEFINE([HAVE_DLADDR],[1],[Have dladdr])])])])
- ])
-
diff --git a/tests/include.am b/tests/include.am
index 414b143b..49d45dd4 100644
--- a/tests/include.am
+++ b/tests/include.am
@@ -27,10 +27,10 @@ noinst_HEADERS+= tests/runner.h
# Cycle should always run first
tests_cycle_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
tests_cycle_CXXFLAGS= $(AM_CXXFLAGS)
-tests_cycle_CXXFLAGS+= ${PTHREAD_CFLAGS}
+tests_cycle_CXXFLAGS+= @PTHREAD_CFLAGS@
tests_cycle_SOURCES= tests/cycle.cc
tests_cycle_LDADD= $(TESTS_LDADDS)
-tests_cycle_LDADD+= ${PTHREAD_LIBS}
+tests_cycle_LDADD+= @PTHREAD_LIBS@
check_PROGRAMS+= tests/cycle
noinst_PROGRAMS+= tests/cycle