m4_include([m4/memcached.m4])
m4_include([m4/memcached_sasl.m4])
m4_include([m4/gearmand.m4])
+m4_include([m4/libgearman.m4])
AM_CONDITIONAL(BUILDING_LIBMEMCACHED, true)
AM_CONDITIONAL(HAVE_LIBMEMCACHED, false)
AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enables libmemcached Support])
AM_CONDITIONAL(BUILDING_GEARMAN, false)
-AM_CONDITIONAL(HAVE_LIBGEARMAN, false)
-AC_DEFINE([HAVE_LIBGEARMAN], [0], [Enables libgearman Support])
AC_SEARCH_LIBS(getopt_long, gnugetopt)
AC_SEARCH_LIBS(gethostbyname, nsl)
libtest_libtest_la_SOURCES+= libtest/gearmand.cc
libtest_libtest_la_SOURCES+= util/instance.cc
libtest_libtest_la_SOURCES+= util/operation.cc
-libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBGEARMAN
-libtest_libtest_la_CXXFLAGS+= -DGEARMAND_BINARY="\"${abs_top_builddir}/gearmand/gearmand\""
libtest_libtest_la_CXXFLAGS+= -DGEARMAND_BLOBSLAP_WORKER="\"${abs_top_builddir}/benchmark/blobslap_worker\""
-libtest_unittest_CXXFLAGS+= -DHAVE_LIBGEARMAN
libtest_unittest_LDADD+= libgearman/libgearman.la
libtest_unittest_DEPENDENCIES+= libgearman/libgearman.la
else
libtest_libtest_la_SOURCES+= libtest/gearmand.cc
libtest_libtest_la_SOURCES+= util/instance.cc
libtest_libtest_la_SOURCES+= util/operation.cc
+libtest_libtest_la_CXXFLAGS+= -DGEARMAND_BLOBSLAP_WORKER=0
else
-libtest_libtest_la_CXXFLAGS+= -DGEARMAND_BINARY=0
libtest_libtest_la_CXXFLAGS+= -DGEARMAND_BLOBSLAP_WORKER=0
-libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBGEARMAN=0
-libtest_unittest_CXXFLAGS+= -DGEARMAND_BINARY=0
-libtest_unittest_CXXFLAGS+= -DHAVE_LIBGEARMAN=0
endif
endif
--- /dev/null
+AX_CHECK_LIBRARY([LIBGEARMAN], [libgearman/gearmand.h], [gearman],
+ [
+ AM_CONDITIONAL(HAVE_LIBGEARMAN, true)
+ AC_DEFINE([HAVE_LIBGEARMAN], [1], [Enables libgearman Support])
+ ],
+ [
+ AM_CONDITIONAL(HAVE_LIBGEARMAN, false)
+ AC_DEFINE([HAVE_LIBGEARMAN], [0], [Enables libgearman Support])
+ ])