From: Brian Aker Date: Wed, 21 Nov 2007 01:24:41 +0000 (-0800) Subject: Updates for pkg-config. X-Git-Tag: 0.10~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=fbe2eb63dd53506cc3acc1507e5226e43d22a6d5;p=awesomized%2Flibmemcached Updates for pkg-config. Tests for "gets" --- diff --git a/ChangeLog b/ChangeLog index 6bb0ee1c..2bdfb8e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ * Fixed type in MEMCACHED_HOST_LOOKUP_FAILURE * Fixed bug where hostname might not be null terminated * Moved to using gethostbyname_r() on Linux to solve thread safety issue + * Added -rpath support for pkg-config 0.9 Thu Nov 15 07:44:00 PST 2007 * fix for when no servers are definied. diff --git a/src/Makefile.am b/src/Makefile.am index 0bf6ec87..004f2e1a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = -I$(top_builddir)/include -LDADDS = ../lib/libmemcached.la +LDADDS = $(top_builddir)/lib/libmemcached.la bin_PROGRAMS = memcat memcp memstat memrm memflush memslap memerror @@ -10,21 +10,29 @@ noinst_HEADERS = client_options.h \ memcat_SOURCES = memcat.c utilities.c memcat_LDADD = $(LDADDS) +memcat_LDFLAGS = -rpath $(pkglibdir) memcp_SOURCES = memcp.c utilities.c memcp_LDADD = $(LDADDS) +memcp_LDFLAGS = -rpath $(pkglibdir) memstat_SOURCES = memstat.c utilities.c memstat_LDADD = $(LDADDS) +memstat_LDFLAGS = -rpath $(pkglibdir) memrm_SOURCES = memrm.c utilities.c memrm_LDADD = $(LDADDS) +memrm_LDFLAGS = -rpath $(pkglibdir) memflush_SOURCES = memflush.c utilities.c memflush_LDADD = $(LDADDS) +memflush_LDFLAGS = -rpath $(pkglibdir) + memerror_SOURCES = memerror.c utilities.c memerror_LDADD = $(LDADDS) +memerror_LDFLAGS = -rpath $(pkglibdir) memslap_SOURCES = memslap.c utilities.c generator.c execute.c memslap_LDADD = $(LDADDS) -lpthread +memslap_LDFLAGS = -rpath $(pkglibdir) diff --git a/support/libmemcached.pc.in b/support/libmemcached.pc.in index cb9d8c38..dfcc0c22 100644 --- a/support/libmemcached.pc.in +++ b/support/libmemcached.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: libmemcached Description: libmemcached C library. Version: @VERSION@ -Libs: -L${libdir} -lmemcached +Libs: -L${libdir} -lmemcached -rpath $(libdir) Cflags: -I${includedir}/@MEMCACHED_LIBRARY_NAME@ diff --git a/tests/function.c b/tests/function.c index 63b56acb..8316ad6c 100644 --- a/tests/function.c +++ b/tests/function.c @@ -1605,6 +1605,24 @@ memcached_return pre_hash_ketama(memcached_st *memc) return MEMCACHED_SUCCESS; } +memcached_return enable_cas(memcached_st *memc) +{ + unsigned int set= 1; + + memcached_version(memc); + + if (memc->hosts[0].major_version >= 1 && + memc->hosts[0].minor_version >= 2 && + memc->hosts[0].micro_version >= 4) + { + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set); + + return MEMCACHED_SUCCESS; + } + + return MEMCACHED_FAILURE; +} + memcached_return check_for_1_2_3(memcached_st *memc) { memcached_version(memc); @@ -1748,6 +1766,7 @@ collection_st collection[] ={ {"ketama", pre_hash_ketama, 0, tests}, {"unix_socket", pre_unix_socket, 0, tests}, {"unix_socket_nodelay", pre_nodelay, 0, tests}, + {"gets", enable_cas, 0, tests}, // {"udp", pre_udp, 0, tests}, {"version_1_2_3", check_for_1_2_3, 0, version_1_2_3}, {"string", 0, 0, string_tests}, diff --git a/tests/output.res b/tests/output.res index a81bf7af..9bd97459 100644 --- a/tests/output.res +++ b/tests/output.res @@ -1178,3 +1178,110 @@ Found key bytes_read Found key bytes_written Found key limit_maxbytes Found key threads +Error 0 -> SUCCESS +Error 1 -> FAILURE +Error 2 -> HOSTNAME LOOKUP FAILURE +Error 3 -> CONNECTION FAILURE +Error 4 -> CONNECTION BIND FAILURE +Error 5 -> WRITE FAILURE +Error 6 -> READ FAILURE +Error 7 -> UNKNOWN READ FAILURE +Error 8 -> PROTOCOL ERROR +Error 9 -> CLIENT ERROR +Error 10 -> SERVER ERROR +Error 11 -> CONNECTION SOCKET CREATE FAILURE +Error 12 -> CONNECTION DATA EXISTS +Error 13 -> CONNECTION DATA DOES NOT EXIST +Error 14 -> NOT STORED +Error 15 -> STORED +Error 16 -> NOT FOUND +Error 17 -> MEMORY ALLOCATION FAILURE +Error 18 -> PARTIAL READ +Error 19 -> SOME ERRORS WERE REPORTED +Error 20 -> NO SERVERS DEFINED +Error 21 -> SERVER END +Error 22 -> SERVER DELETE +Error 23 -> SERVER VALUE +Error 24 -> STAT VALUE +Error 25 -> SYSTEM ERROR +Error 26 -> COULD NOT OPEN UNIX SOCKET +Error 27 -> ACTION NOT SUPPORTED +Error 28 -> A KEY LENGTH OF ZERO WAS PROVIDED +Found key pid +Found key uptime +Found key time +Found key version +Found key pointer_size +Found key rusage_user +Found key rusage_system +Found key rusage_user_seconds +Found key rusage_user_microseconds +Found key rusage_system_seconds +Found key rusage_system_microseconds +Found key curr_items +Found key total_items +Found key bytes +Found key curr_connections +Found key total_connections +Found key connection_structures +Found key cmd_get +Found key cmd_set +Found key get_hits +Found key get_misses +Found key evictions +Found key bytes_read +Found key bytes_written +Found key limit_maxbytes +Found key threads +Found key pid +Found key uptime +Found key time +Found key version +Found key pointer_size +Found key rusage_user +Found key rusage_system +Found key rusage_user_seconds +Found key rusage_user_microseconds +Found key rusage_system_seconds +Found key rusage_system_microseconds +Found key curr_items +Found key total_items +Found key bytes +Found key curr_connections +Found key total_connections +Found key connection_structures +Found key cmd_get +Found key cmd_set +Found key get_hits +Found key get_misses +Found key evictions +Found key bytes_read +Found key bytes_written +Found key limit_maxbytes +Found key threads +Found key pid +Found key uptime +Found key time +Found key version +Found key pointer_size +Found key rusage_user +Found key rusage_system +Found key rusage_user_seconds +Found key rusage_user_microseconds +Found key rusage_system_seconds +Found key rusage_system_microseconds +Found key curr_items +Found key total_items +Found key bytes +Found key curr_connections +Found key total_connections +Found key connection_structures +Found key cmd_get +Found key cmd_set +Found key get_hits +Found key get_misses +Found key evictions +Found key bytes_read +Found key bytes_written +Found key limit_maxbytes +Found key threads