Clean up some library usage.
authorBrian Aker <brian@tangent.org>
Thu, 21 Nov 2013 11:01:39 +0000 (06:01 -0500)
committerBrian Aker <brian@tangent.org>
Thu, 21 Nov 2013 11:01:39 +0000 (06:01 -0500)
configure.ac
libmemcached/include.am
libtest/include.am
m4/ax_check_library.m4
m4/ax_dlopen.m4 [deleted file]
tests/include.am

index 54177ac4656dac2547fdf244d72c6e1dd34a739c..696f9baef0053eaaea1f30bee708c6d8bbdb92ef 100644 (file)
@@ -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])
index 4c9af2138e6210336024e2be759d5a75208e2c45..1eccc3695f3bad09cd86fe35fa4f2ec64c37b694 100644 (file)
@@ -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
index 4d1d8428dc3e4d79b2cb27ea9ee2565d4754fe80..27682be2453304b7ff73de7f66b4a15bc9055998 100644 (file)
@@ -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
index dd27ff41ff15727790a0ed0f4950f1a1cfd872f9..35ab7114324017a423304a72582ffd7a4ba0f2b4 100644 (file)
@@ -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 (file)
index 514c578..0000000
+++ /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])])])])
-    ])
-
index 414b143b393c69039a5f652f81f9e430eb6dc516..49d45dd42d9a8a4ecfbaabea60a2d3f6e1968c94 100644 (file)
@@ -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