Merge from trunk.
authorPadraig O'Sullivan <osullivan.padraig@gmail.com>
Thu, 17 Sep 2009 19:14:25 +0000 (15:14 -0400)
committerPadraig O'Sullivan <osullivan.padraig@gmail.com>
Thu, 17 Sep 2009 19:14:25 +0000 (15:14 -0400)
55 files changed:
.bzrignore
ChangeLog
clients/Makefile.am
clients/execute.c
clients/generator.c
clients/memcat.c
clients/memcp.c
clients/memdump.c
clients/memerror.c
clients/memflush.c
clients/memrm.c
clients/memslap.c
clients/memstat.c
clients/utilities.c
clients/utilities.h
config/autorun.sh
configure.ac
libmemcached/crc.c
libmemcached/memcached.h
libmemcached/memcached_auto.c
libmemcached/memcached_behavior.c
libmemcached/memcached_connect.c
libmemcached/memcached_hash.c
libmemcached/murmur_hash.c
m4/pandora_64bit.m4
m4/pandora_canonical.m4
m4/pandora_enable_dtrace.m4
m4/pandora_ensure_gcc_version.m4
m4/pandora_extensions.m4 [new file with mode: 0644]
m4/pandora_have_better_malloc.m4
m4/pandora_have_libdrizzle.m4
m4/pandora_have_libgearman.m4
m4/pandora_have_libmemcached.m4
m4/pandora_have_libpq.m4
m4/pandora_have_libsqlite3.m4 [new file with mode: 0644]
m4/pandora_have_protobuf.m4 [new file with mode: 0644]
m4/pandora_have_sqlite.m4 [deleted file]
m4/pandora_platform.m4 [new file with mode: 0644]
m4/pandora_plugins.m4 [new file with mode: 0644]
m4/pandora_pthread.m4 [new file with mode: 0644]
m4/pandora_python3_devel.m4 [new file with mode: 0644]
m4/pandora_swig.m4 [new file with mode: 0644]
m4/pandora_use_pipe.m4 [new file with mode: 0644]
m4/pandora_vc_build.m4
m4/pandora_warnings.m4
m4/pandora_with_lua.m4 [new file with mode: 0644]
m4/pandora_with_perl.m4 [new file with mode: 0644]
m4/pandora_with_php.m4 [new file with mode: 0644]
m4/pandora_with_python.m4 [new file with mode: 0644]
m4/pandora_with_python3.m4 [new file with mode: 0644]
m4/pandora_with_r.m4 [new file with mode: 0644]
m4/pandora_with_ruby.m4 [new file with mode: 0644]
m4/pkg.m4 [new file with mode: 0644]
tests/Makefile.am
tests/function.c

index 55777a950e9a087fa15225b3a3d77f3d77b143b7..dc1898a6b765711c72159b16ac1655d604029731 100644 (file)
@@ -1,16 +1,16 @@
+*.lo
+*/.deps
+*/.libs
+*/Makefile
+*/Makefile.in
+*/*.l[oa]
+*TAGS
 INSTALL
 Makefile
 Makefile.in
+TAGS
 aclocal.m4
 autom4te.cache
-config.log
-config.status
-configure
-libtool
-clients/.deps
-clients/.libs
-clients/Makefile
-clients/Makefile.in
 clients/memcat
 clients/memcp
 clients/memdump
@@ -19,155 +19,41 @@ clients/memflush
 clients/memrm
 clients/memslap
 clients/memstat
+config.h
+config.h.in
+config.log
+config.status
+config/compile
 config/config.guess
 config/config.sub
 config/depcomp
 config/install-sh
 config/ltmain.sh
 config/missing
-docs/Makefile
-docs/Makefile.in
-docs/libmemcached.3
-docs/libmemcached_examples.3
-docs/libmemcachedutil.3
-docs/memcached_add.3
-docs/memcached_add_by_key.3
-docs/memcached_analyze.3
-docs/memcached_append.3
-docs/memcached_append_by_key.3
-docs/memcached_behavior_get.3
-docs/memcached_behavior_set.3
-docs/memcached_callback_get.3
-docs/memcached_callback_set.3
-docs/memcached_cas.3
-docs/memcached_cas_by_key.3
-docs/memcached_clone.3
-docs/memcached_create.3
-docs/memcached_decrement.3
-docs/memcached_decrement_with_initial.3
-docs/memcached_delete.3
-docs/memcached_delete_by_key.3
-docs/memcached_dump.3
-docs/memcached_fetch.3
-docs/memcached_fetch_execute.3
-docs/memcached_fetch_result.3
-docs/memcached_flush_buffers.3
-docs/memcached_free.3
-docs/memcached_generate_hash_value.3
-docs/memcached_get.3
-docs/memcached_get_by_key.3
-docs/memcached_increment.3
-docs/memcached_increment_with_initial.3
-docs/memcached_lib_version.3
-docs/memcached_mget.3
-docs/memcached_mget_by_key.3
-docs/memcached_pool_create.3
-docs/memcached_pool_destroy.3
-docs/memcached_pool_pop.3
-docs/memcached_pool_push.3
-docs/memcached_prepend.3
-docs/memcached_prepend_by_key.3
-docs/memcached_quit.3
-docs/memcached_replace.3
-docs/memcached_replace_by_key.3
-docs/memcached_server_add.3
-docs/memcached_server_count.3
-docs/memcached_server_list.3
-docs/memcached_server_list_append.3
-docs/memcached_server_list_count.3
-docs/memcached_server_list_free.3
-docs/memcached_server_push.3
-docs/memcached_servers_parse.3
-docs/memcached_set.3
-docs/memcached_set_by_key.3
-docs/memcached_stat.3
-docs/memcached_stat_get_keys.3
-docs/memcached_stat_get_value.3
-docs/memcached_stat_servername.3
-docs/memcached_strerror.3
-docs/memcached_verbosity.3
-docs/memcached_version.3
-docs/memcat.1
-docs/memcp.1
-docs/memdump.1
-docs/memerror.1
-docs/memflush.1
-docs/memrm.1
-docs/memslap.1
-docs/memstat.1
-docs/memcached_set_memory_allocators.3
-docs/memcached_get_memory_allocators.3
-docs/memcached_set_user_data.3
-docs/memcached_get_user_data.3
-libmemcached/.deps
-libmemcached/.libs
-libmemcached/Makefile
-libmemcached/Makefile.in
-libmemcached/byteorder.lo
-libmemcached/crc.lo
-libmemcached/jenkins_hash.lo
-libmemcached/libmemcached.la
-libmemcached/libmemcached_config.h
-libmemcached/libmemcached_config.h.in
+configure
+docs/*.[13]
+libmemcached-*.tar.gz
 libmemcached/memcached_configure.h
-libmemcached/md5.lo
-libmemcached/memcached.lo
-libmemcached/memcached_analyze.lo
-libmemcached/memcached_auto.lo
-libmemcached/memcached_behavior.lo
-libmemcached/memcached_callback.lo
-libmemcached/memcached_connect.lo
-libmemcached/memcached_delete.lo
-libmemcached/memcached_do.lo
-libmemcached/memcached_dump.lo
-libmemcached/memcached_fetch.lo
-libmemcached/memcached_flush.lo
-libmemcached/memcached_flush_buffers.lo
-libmemcached/memcached_get.lo
-libmemcached/memcached_hash.lo
-libmemcached/memcached_hosts.lo
-libmemcached/memcached_io.lo
-libmemcached/memcached_key.lo
-libmemcached/memcached_parse.lo
-libmemcached/memcached_purge.lo
-libmemcached/memcached_quit.lo
-libmemcached/memcached_response.lo
-libmemcached/memcached_result.lo
-libmemcached/memcached_server.lo
-libmemcached/memcached_stats.lo
-libmemcached/memcached_storage.lo
-libmemcached/memcached_strerror.lo
-libmemcached/memcached_string.lo
-libmemcached/memcached_verbosity.lo
-libmemcached/memcached_version.lo
-libmemcached/murmur_hash.lo
-libmemcached/stamp-h1
-libmemcachedutil/.deps
-libmemcachedutil/.libs
-libmemcachedutil/Makefile
-libmemcachedutil/Makefile.in
-libmemcachedutil/libmemcachedutil.la
-libmemcachedutil/memcached_pool.lo
+libtool
+libtool.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+lt~obsolete.m4
+stamp-h1
 support/Makefile
 support/Makefile.in
 support/libmemcached-fc.spec
 support/libmemcached.pc
 support/libmemcached.spec
-tests/.deps
-tests/.libs
-tests/Makefile
-tests/Makefile.in
 tests/atomsmasher
 tests/output.cmp
 tests/startservers
 tests/testapp
 tests/testplus
 tests/udptest
-lt~obsolete.m4
-ltoptions.m4
-ltsugar.m4
-ltversion.m4
-libtool.m4
-TAGS
-*TAGS
-*.lo
+libmemcached-0.30-1.src.rpm
+libmemcached-0.30-1.x86_64.rpm
+libmemcached-0.31-1.src.rpm
+libmemcached-0.31-1.x86_64.rpm
+config/plugin.ac
index 45cb774f61ccbea85d5771195c29789f609b8052..6c9641fc8928e67426ac3424c0a7cc58286109de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+  0.32 Tue Sep 15 15:49:09 PDT 2009
+  * Change of behavior where linger is only modified for no-block and then
+    it is set to zero.
   * Added Twitter's memcached_server_error() functions.
   * Fix for OSX compiles in development builds.
   * Updated C++ interface.
index 244c80d3b9e5a01b7759e581b5acce77841b2e1a..7eba92863adf6d1dca8011bfd53198fb49f10258 100644 (file)
@@ -1,4 +1,4 @@
-LDADDS = $(top_builddir)/libmemcached/libmemcached.la libutilities.la
+LDADDS = libutilities.la $(top_builddir)/libmemcached/libmemcached.la
 
 bin_PROGRAMS = memcat memdump memcp memstat memrm memflush memslap memerror
 
@@ -14,36 +14,28 @@ libgenexec_la_SOURCES= generator.c execute.c
 
 memcat_SOURCES = memcat.c
 memcat_LDADD = $(LDADDS)
-memcat_LDFLAGS = -rpath $(pkglibdir)
 
 memcp_SOURCES = memcp.c
 memcp_LDADD = $(LDADDS)
-memcp_LDFLAGS = -rpath $(pkglibdir)
 
 memdump_SOURCES = memdump.c
 memdump_LDADD = $(LDADDS)
-memdump_LDFLAGS = -rpath $(pkglibdir)
 
 memstat_SOURCES = memstat.c
 memstat_LDADD = $(LDADDS)
-memstat_LDFLAGS = -rpath $(pkglibdir)
 
 memrm_SOURCES = memrm.c
 memrm_LDADD = $(LDADDS)
-memrm_LDFLAGS = -rpath $(pkglibdir)
 
 memflush_SOURCES = memflush.c
 memflush_LDADD = $(LDADDS)
-memflush_LDFLAGS = -rpath $(pkglibdir)
 
 memerror_SOURCES = memerror.c
 memerror_LDADD = $(LDADDS)
-memerror_LDFLAGS = -rpath $(pkglibdir)
 
 memslap_SOURCES = memslap.c
 memslap_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
-memslap_LDADD = $(LDADDS) $(PTHREAD_LIBS) libgenexec.la
-memslap_LDFLAGS = $(AM_LDFLAGS) -rpath $(pkglibdir)
+memslap_LDADD = $(PTHREAD_LIBS) libgenexec.la $(LDADDS) 
 
 test-start-server:
        memflush --servers=localhost
index a0e31ee9d51eab651a4e08cd269c2dc993ba15b7..e25483392e2876e51b61b202c684a437bd23f423 100644 (file)
@@ -46,7 +46,7 @@ unsigned int execute_get(memcached_st *memc, pairs_st *pairs, unsigned int numbe
     uint32_t flags;
     unsigned int fetch_key;
 
-    fetch_key= (unsigned int)(random() % number_of);
+    fetch_key= (unsigned int)random() % number_of;
 
     value= memcached_get(memc, pairs[fetch_key].key, pairs[fetch_key].key_length,
                          &value_length, &flags, &rc);
index cd1a17bfe71059fceb49fff382b7975220284b35..213246ba2206a3d84916c8503c43c089bc26e975 100644 (file)
@@ -47,9 +47,7 @@ void pairs_free(pairs_st *pairs)
 pairs_st *pairs_generate(uint64_t number_of, size_t value_length)
 {
   unsigned int x;
-  pairs_st *pairs;
-
-  pairs= (pairs_st*)calloc(number_of + 1, sizeof(pairs_st));
+  pairs_st *pairs= calloc((size_t)(number_of + 1), sizeof(pairs_st));
 
   if (!pairs)
     goto error;
index 1c659b781531fce0593c3406d30f6a0c5912c96b..944afe721467a009da8ed1ce4343323f5c7e7641 100644 (file)
@@ -110,14 +110,14 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
     {
-      {"version", no_argument, NULL, OPT_VERSION},
-      {"help", no_argument, NULL, OPT_HELP},
-      {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-      {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-      {"servers", required_argument, NULL, OPT_SERVERS},
-      {"flag", no_argument, &opt_displayflag, OPT_FLAG},
-      {"hash", required_argument, NULL, OPT_HASH},
-      {"binary", no_argument, NULL, OPT_BINARY},
+      {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+      {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+      {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+      {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+      {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+      {(OPTIONSTRING)"flag", no_argument, &opt_displayflag, OPT_FLAG},
+      {(OPTIONSTRING)"hash", required_argument, NULL, OPT_HASH},
+      {(OPTIONSTRING)"binary", no_argument, NULL, OPT_BINARY},
       {0, 0, 0, 0},
     };
 
index 778beaf783c10298201666453d86ed34ea698ba0..716bfefd03482e94c40d8b881260e598c2d55206 100644 (file)
@@ -165,18 +165,18 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
     {
-      {"version", no_argument, NULL, OPT_VERSION},
-      {"help", no_argument, NULL, OPT_HELP},
-      {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-      {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-      {"servers", required_argument, NULL, OPT_SERVERS},
-      {"flag", required_argument, NULL, OPT_FLAG},
-      {"expire", required_argument, NULL, OPT_EXPIRE},
-      {"set",  no_argument, NULL, OPT_SET},
-      {"add",  no_argument, NULL, OPT_ADD},
-      {"replace",  no_argument, NULL, OPT_REPLACE},
-      {"hash", required_argument, NULL, OPT_HASH},
-      {"binary", no_argument, NULL, OPT_BINARY},
+      {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+      {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+      {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+      {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+      {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+      {(OPTIONSTRING)"flag", required_argument, NULL, OPT_FLAG},
+      {(OPTIONSTRING)"expire", required_argument, NULL, OPT_EXPIRE},
+      {(OPTIONSTRING)"set",  no_argument, NULL, OPT_SET},
+      {(OPTIONSTRING)"add",  no_argument, NULL, OPT_ADD},
+      {(OPTIONSTRING)"replace",  no_argument, NULL, OPT_REPLACE},
+      {(OPTIONSTRING)"hash", required_argument, NULL, OPT_HASH},
+      {(OPTIONSTRING)"binary", no_argument, NULL, OPT_BINARY},
       {0, 0, 0, 0},
     };
 
index 3dc687d8e8d3a27f23954836b26f3bd4944b5c40..1a21ab64e9be365b34c599f416bf0db58d92896c 100644 (file)
@@ -102,13 +102,13 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
     {
-      {"version", no_argument, NULL, OPT_VERSION},
-      {"help", no_argument, NULL, OPT_HELP},
-      {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-      {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-      {"servers", required_argument, NULL, OPT_SERVERS},
-      {"hash", required_argument, NULL, OPT_HASH},
-      {"binary", no_argument, NULL, OPT_BINARY},
+      {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+      {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+      {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+      {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+      {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+      {(OPTIONSTRING)"hash", required_argument, NULL, OPT_HASH},
+      {(OPTIONSTRING)"binary", no_argument, NULL, OPT_BINARY},
       {0, 0, 0, 0}
     };
 
index b70f88300792a71516a597090bb31e48874b9866..fbad55ba2f00245d2182bcbda522ee20c3428647 100644 (file)
@@ -43,10 +43,10 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
     {
-      {"version", no_argument, NULL, OPT_VERSION},
-      {"help", no_argument, NULL, OPT_HELP},
-      {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-      {"debug", no_argument, &opt_verbose, OPT_DEBUG},
+      {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+      {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+      {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+      {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
       {0, 0, 0, 0},
     };
 
index 0d2727bfe274ce3548144b0df4a194e0e4188458..12034adba47e249619b65775b8d66d8ecf375150 100644 (file)
@@ -74,13 +74,13 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
   {
-    {"version", no_argument, NULL, OPT_VERSION},
-    {"help", no_argument, NULL, OPT_HELP},
-    {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-    {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-    {"servers", required_argument, NULL, OPT_SERVERS},
-    {"expire", required_argument, NULL, OPT_EXPIRE},
-    {"binary", no_argument, NULL, OPT_BINARY},
+    {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+    {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+    {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+    {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+    {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+    {(OPTIONSTRING)"expire", required_argument, NULL, OPT_EXPIRE},
+    {(OPTIONSTRING)"binary", no_argument, NULL, OPT_BINARY},
     {0, 0, 0, 0},
   };
   int option_index= 0;
index 8ed122d77b2283dd3240f35d1f55f76e30e79f79..203146efae04ca2df288901ec19473429c9c6a9d 100644 (file)
@@ -87,14 +87,14 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
   {
-    {"version", no_argument, NULL, OPT_VERSION},
-    {"help", no_argument, NULL, OPT_HELP},
-    {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-    {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-    {"servers", required_argument, NULL, OPT_SERVERS},
-    {"expire", required_argument, NULL, OPT_EXPIRE},
-    {"hash", required_argument, NULL, OPT_HASH},
-    {"binary", no_argument, NULL, OPT_BINARY},
+    {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+    {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+    {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+    {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+    {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+    {(OPTIONSTRING)"expire", required_argument, NULL, OPT_EXPIRE},
+    {(OPTIONSTRING)"hash", required_argument, NULL, OPT_HASH},
+    {(OPTIONSTRING)"binary", no_argument, NULL, OPT_BINARY},
     {0, 0, 0, 0},
   };
   int option_index= 0;
index 279be30b67d4e9aa9df96fda4607280574320a92..4e3d6813f05742cc6ba4a26a7f64446d306e62bf 100644 (file)
@@ -238,21 +238,21 @@ void options_parse(int argc, char *argv[])
 
   static struct option long_options[]=
     {
-      {"concurrency", required_argument, NULL, OPT_SLAP_CONCURRENCY},
-      {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-      {"execute-number", required_argument, NULL, OPT_SLAP_EXECUTE_NUMBER},
-      {"flag", no_argument, &opt_displayflag, OPT_FLAG},
-      {"flush", no_argument, &opt_flush, OPT_FLUSH},
-      {"help", no_argument, NULL, OPT_HELP},
-      {"initial-load", required_argument, NULL, OPT_SLAP_INITIAL_LOAD}, /* Number to load initially */
-      {"non-blocking", no_argument, &opt_non_blocking_io, OPT_SLAP_NON_BLOCK},
-      {"servers", required_argument, NULL, OPT_SERVERS},
-      {"tcp-nodelay", no_argument, &opt_tcp_nodelay, OPT_SLAP_TCP_NODELAY},
-      {"test", required_argument, NULL, OPT_SLAP_TEST},
-      {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-      {"version", no_argument, NULL, OPT_VERSION},
-      {"binary", no_argument, NULL, OPT_BINARY},
-      {"udp", no_argument, NULL, OPT_UDP},
+      {(OPTIONSTRING)"concurrency", required_argument, NULL, OPT_SLAP_CONCURRENCY},
+      {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+      {(OPTIONSTRING)"execute-number", required_argument, NULL, OPT_SLAP_EXECUTE_NUMBER},
+      {(OPTIONSTRING)"flag", no_argument, &opt_displayflag, OPT_FLAG},
+      {(OPTIONSTRING)"flush", no_argument, &opt_flush, OPT_FLUSH},
+      {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+      {(OPTIONSTRING)"initial-load", required_argument, NULL, OPT_SLAP_INITIAL_LOAD}, /* Number to load initially */
+      {(OPTIONSTRING)"non-blocking", no_argument, &opt_non_blocking_io, OPT_SLAP_NON_BLOCK},
+      {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+      {(OPTIONSTRING)"tcp-nodelay", no_argument, &opt_tcp_nodelay, OPT_SLAP_TCP_NODELAY},
+      {(OPTIONSTRING)"test", required_argument, NULL, OPT_SLAP_TEST},
+      {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+      {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+      {(OPTIONSTRING)"binary", no_argument, NULL, OPT_BINARY},
+      {(OPTIONSTRING)"udp", no_argument, NULL, OPT_UDP},
       {0, 0, 0, 0},
     };
 
index 27c34a41c2caf4ad048c3bb4f8320cfe5950142a..e6783b68c095c7a8de4b2f88309a2ce5f53aceed 100644 (file)
@@ -35,13 +35,13 @@ static char *analyze_mode= NULL;
 
 static struct option long_options[]=
 {
-  {"version", no_argument, NULL, OPT_VERSION},
-  {"help", no_argument, NULL, OPT_HELP},
-  {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
-  {"debug", no_argument, &opt_verbose, OPT_DEBUG},
-  {"servers", required_argument, NULL, OPT_SERVERS},
-  {"flag", no_argument, &opt_displayflag, OPT_FLAG},
-  {"analyze", optional_argument, NULL, OPT_ANALYZE},
+  {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+  {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+  {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+  {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+  {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+  {(OPTIONSTRING)"flag", no_argument, &opt_displayflag, OPT_FLAG},
+  {(OPTIONSTRING)"analyze", optional_argument, NULL, OPT_ANALYZE},
   {0, 0, 0, 0},
 };
 
@@ -169,11 +169,11 @@ static void run_analyzer(memcached_st *memc, memcached_stat_st *memc_stat,
       gettimeofday(&end_time, NULL);
 
       elapsed_time= timedif(end_time, start_time);
-      elapsed_time /= num_of_tests;
+      elapsed_time /= (long)num_of_tests;
 
       if (elapsed_time > slowest_time)
       {
-        slowest_server= x;
+        slowest_server= (long)x;
         slowest_time= elapsed_time;
       }
 
index 9ad6edcf90789310dea7d3c4da3abcc8dbb45ac1..e7d8df94b067302c8ca2095501d2f5fa03c6e1ab 100644 (file)
@@ -28,7 +28,7 @@ static const char *lookup_help(memcached_options option)
   {
   case OPT_SERVERS: return("List which servers you wish to connect to.");
   case OPT_VERSION: return("Display the version of the application and then exit.");
-  case OPT_HELP: return("Diplay this message and then exit.");
+  case OPT_HELP: return("Display this message and then exit.");
   case OPT_VERBOSE: return("Give more details on the progression of the application.");
   case OPT_DEBUG: return("Provide output only useful for debugging.");
   case OPT_FLAG: return("Provide flag information for storage operation.");
index af6706135b84a19232b4162ee1e542d0d0188f3f..7ca92497ccbb3b855349dc358712d38c355589fd 100644 (file)
 # endif
 #endif
 
+#ifdef __sun
+  /* For some odd reason the option struct on solaris defines the argument
+   * as char* and not const char*
+   */
+#define OPTIONSTRING char*
+#else
+#define OPTIONSTRING const char*
+#endif
+
 typedef struct memcached_programs_help_st memcached_programs_help_st;
 
 struct memcached_programs_help_st 
index 2e0d839f779d6ab50b5bc3195d64b37a81f5bd3b..4785b9fccab1d95e75873d89bf0f06b82ab393b9 100755 (executable)
@@ -35,6 +35,18 @@ locate_binary() {
   return 1
 }
 
+
+if test -f config/pre_hook.sh
+then
+  . config/pre_hook.sh
+fi
+
+# We need to some file here for the m4_sinclude, even if it's just empty
+if test ! -f config/plugin.ac
+then
+  touch config/plugin.ac
+fi
+
 # Try to detect the supported binaries if the user didn't
 # override that by pushing the environment variable
 if test x$LIBTOOLIZE = x; then
@@ -45,14 +57,14 @@ if test x$LIBTOOLIZE = x; then
 fi
 
 if test x$ACLOCAL = x; then
-  ACLOCAL=`locate_binary aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
+  ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
   if test x$ACLOCAL = x; then
     die "Did not find a supported aclocal"
   fi
 fi
 
 if test x$AUTOMAKE = x; then
-  AUTOMAKE=`locate_binary automake-1.10 automake-1.9 automake19 automake`
+  AUTOMAKE=`locate_binary automake-1.11 automake-1.10 automake-1.9 automake19 automake`
   if test x$AUTOMAKE = x; then
     die "Did not find a supported automake"
   fi
@@ -78,6 +90,11 @@ run $AUTOHEADER || die "Can't execute autoheader"
 run $AUTOMAKE $AUTOMAKE_FLAGS  || die "Can't execute automake"
 run $AUTOCONF || die "Can't execute autoconf"
 
+if test -f config/post_hook.sh
+then
+  . config/post_hook.sh
+fi
+
 echo "---"
 echo "Configured with the following tools:"
 echo "  * `$LIBTOOLIZE --version | head -1`"
index 7b14a248b0e0a9fe0d826c5300b5686243aec7bb..6ce3f3c9d07c81540c9f6ff2e634aba39f04c8e8 100644 (file)
@@ -6,7 +6,7 @@
 # the COPYING file in this directory for full text.
 
 AC_PREREQ(2.59)
-AC_INIT([libmemcached],[0.31],[http://tangent.org/552/libmemcached.html])
+AC_INIT([libmemcached],[0.32],[http://tangent.org/552/libmemcached.html])
 AC_CONFIG_SRCDIR([libmemcached/memcached.c])
 AC_CONFIG_AUX_DIR(config)
 AM_CONFIG_HEADER([config.h])
@@ -15,7 +15,7 @@ AC_CONFIG_MACRO_DIR([m4])
 PANDORA_CANONICAL_TARGET
 
 #shared library versioning
-MEMCACHED_LIBRARY_VERSION=2:0:0
+MEMCACHED_LIBRARY_VERSION=3:0:0
 #                         | | |
 #                  +------+ | +---+
 #                  |        |     |
index 5c586bf0ab8663cea7ce90a79a2a11abb4d5be96..034ccf1b035e35e9f8064ff6e5a5c6197b055a4b 100644 (file)
@@ -80,7 +80,7 @@ uint32_t hash_crc32(const char *key, size_t key_length)
   uint32_t crc= UINT32_MAX;
 
   for (x= 0; x < key_length; x++)
-    crc= (crc >> 8) ^ crc32tab[(crc ^ (key[x])) & 0xff];
+     crc= (crc >> 8) ^ crc32tab[(crc ^ (uint64_t)key[x]) & 0xff];
 
   return ~crc;
 }
index c3b436bf2ff721481d5e1bf41de99f01d433ced4..3fc9382640d03b61f443defaa668ba50b878205d 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
 #endif
 
 #define MEMCACHED_VERSION_STRING_LENGTH 24
-#define LIBMEMCACHED_VERSION_STRING "0.31"
+#define LIBMEMCACHED_VERSION_STRING "0.32"
 
 struct memcached_analysis_st {
   uint32_t average_item_size;
index c0c6269af7a71ce64f71d7c9e15a830fe9e1b0ed..084d7a381c37deb2d30c0d6371f7ced08b9604f0 100644 (file)
@@ -63,7 +63,7 @@ static memcached_return memcached_auto(memcached_st *ptr,
 static memcached_return binary_incr_decr(memcached_st *ptr, uint8_t cmd,
                                          const char *key, size_t key_length,
                                          uint64_t offset, uint64_t initial,
-                                         time_t expiration,
+                                         uint32_t expiration,
                                          uint64_t *value) 
 {
   unsigned int server_key;
@@ -165,7 +165,8 @@ memcached_return memcached_increment_with_initial(memcached_st *ptr,
   LIBMEMCACHED_MEMCACHED_INCREMENT_WITH_INITIAL_START();
   if (ptr->flags & MEM_BINARY_PROTOCOL)
     rc= binary_incr_decr(ptr, PROTOCOL_BINARY_CMD_INCREMENT, key,
-                         key_length, offset, initial, expiration, value);
+                         key_length, offset, initial, (uint32_t)expiration, 
+                         value);
   else
     rc= MEMCACHED_PROTOCOL_ERROR;
 
@@ -189,7 +190,8 @@ memcached_return memcached_decrement_with_initial(memcached_st *ptr,
   LIBMEMCACHED_MEMCACHED_DECREMENT_WITH_INITIAL_START();
   if (ptr->flags & MEM_BINARY_PROTOCOL)
     rc= binary_incr_decr(ptr, PROTOCOL_BINARY_CMD_DECREMENT, key,
-                         key_length, offset, initial, expiration, value);
+                         key_length, offset, initial, (uint32_t)expiration,
+                         value);
   else
     rc= MEMCACHED_PROTOCOL_ERROR;
 
index 5241c3c8f7eb700c0206fb8388682afc7601bddb..dd9884892ca89ef8d0bf822015e8ae365053e823 100644 (file)
@@ -225,17 +225,11 @@ uint64_t memcached_behavior_get(memcached_st *ptr,
     temp_flag= MEM_USE_SORT_HOSTS;
     break;
   case MEMCACHED_BEHAVIOR_POLL_TIMEOUT:
-    {
-      return (uint64_t)ptr->poll_timeout;
-    }
+    return (uint64_t)ptr->poll_timeout;
   case MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT:
-    {
-      return (uint64_t)ptr->connect_timeout;
-    }
+    return (uint64_t)ptr->connect_timeout;
   case MEMCACHED_BEHAVIOR_RETRY_TIMEOUT:
-    {
-      return (uint64_t)ptr->retry_timeout;
-    }
+    return (uint64_t)ptr->retry_timeout;
   case MEMCACHED_BEHAVIOR_SND_TIMEOUT:
     return (uint64_t)ptr->snd_timeout;
   case MEMCACHED_BEHAVIOR_RCV_TIMEOUT:
index 93738f4aa3d9173b3fc59d9e53b958b0b4ea31c6..833ad0efba97f9b9eb126d7f177ab1bb4147aff9 100644 (file)
@@ -81,12 +81,13 @@ static memcached_return set_socket_options(memcached_server_st *ptr)
   }
 #endif
 
+  if (ptr->root->flags & MEM_NO_BLOCK)
   {
     int error;
     struct linger linger;
 
     linger.l_onoff= 1; 
-    linger.l_linger= MEMCACHED_DEFAULT_TIMEOUT; 
+    linger.l_linger= 0; /* By default on close() just drop the socket */ 
     error= setsockopt(ptr->fd, SOL_SOCKET, SO_LINGER, 
                       &linger, (socklen_t)sizeof(struct linger));
     WATCHPOINT_ASSERT(error == 0);
index 4956d18e0655e784bbb4e7a4b3c0200d4552bb77..129d76127e8e7271a5d19861892da6b4c474addd 100644 (file)
@@ -40,7 +40,7 @@ uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memca
       for (x= 0; x < key_length; x++) 
       {
         temp_hash *= FNV_64_PRIME;
-        temp_hash ^= key[x];
+        temp_hash ^= (uint64_t)key[x];
       }
       hash= (uint32_t)temp_hash;
     }
@@ -50,7 +50,8 @@ uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memca
       hash= (uint32_t) FNV_64_INIT;
       for (x= 0; x < key_length; x++) 
       {
-        hash ^= key[x];
+        uint32_t val= (uint32_t)key[x];
+        hash ^= val;
         hash *= (uint32_t) FNV_64_PRIME;
       }
     }
@@ -60,8 +61,9 @@ uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memca
       hash= FNV_32_INIT;
       for (x= 0; x < key_length; x++) 
       {
+        uint32_t val= (uint32_t)key[x];
         hash *= FNV_32_PRIME;
-        hash ^= key[x];
+        hash ^= val;
       }
     }
     break;
@@ -70,7 +72,8 @@ uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memca
       hash= FNV_32_INIT;
       for (x= 0; x < key_length; x++) 
       {
-        hash ^= key[x];
+        uint32_t val= (uint32_t)key[x];
+        hash ^= val;
         hash *= FNV_32_PRIME;
       }
     }
@@ -205,7 +208,8 @@ static uint32_t internal_generate_hash(const char *key, size_t key_length)
 
   while (key_length--) 
   {
-    value += (uint32_t) *ptr++;
+    uint32_t val= (uint32_t) *ptr++;
+    value += val;
     value += (value << 10);
     value ^= (value >> 6);
   }
index b95134408d287270b17508af10f2325f9d6035c4..f1c3267c53844ee903889d913fba3e0f8b95797d 100644 (file)
@@ -25,13 +25,13 @@ uint32_t murmur_hash(const char *key, size_t length)
   */
 
   const unsigned int m= 0x5bd1e995;
-  const size_t seed= (0xdeadbeef * length);
+  const uint32_t seed= (0xdeadbeef * (uint32_t)length);
   const int r= 24;
 
 
   // Initialize the hash to a 'random' value
 
-  size_t h= seed ^ length;
+  uint32_t h= seed ^ (uint32_t)length;
 
   // Mix 4 bytes at a time into the hash
 
@@ -56,8 +56,8 @@ uint32_t murmur_hash(const char *key, size_t length)
 
   switch(length)
   {
-  case 3: h ^= data[2] << 16;
-  case 2: h ^= data[1] << 8;
+  case 3: h ^= ((uint32_t)data[2]) << 16;
+  case 2: h ^= ((uint32_t)data[1]) << 8;
   case 1: h ^= data[0];
           h *= m;
   default: break;
index 99db56e004cac6f309e563a4b95a42a5b9b34d7b..ed123d2b893f56030aa766e68a7de8db52b2bbda 100644 (file)
@@ -9,12 +9,11 @@ dnl ---------------------------------------------------------------------------
 AC_DEFUN([PANDORA_64BIT],[
   AC_BEFORE([$0], [AC_LIB_PREFIX])
 
-
-  AC_ARG_ENABLE([64bit],[
-    AS_HELP_STRING([--disable-64bit],
+  AC_ARG_ENABLE([64bit],
+    [AS_HELP_STRING([--disable-64bit],
       [Build 64 bit binary @<:@default=on@:>@])],
-             [ac_enable_64bit="$enableval"],
-             [ac_enable_64bit="yes"])
+    [ac_enable_64bit="$enableval"],
+    [ac_enable_64bit="yes"])
 
   AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
   AS_IF([test "x$ISAINFO" != "xno"],
@@ -24,25 +23,31 @@ AC_DEFUN([PANDORA_64BIT],[
   AS_IF([test "$isainfo_b" != "x"],[
 
     isainfo_k=`${ISAINFO} -k` 
-    DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}"
+    DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
 
-    AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[
-      CPPFLAGS="-I/usr/local ${CPPFLAGS}"
-    ])
+    AS_IF([test "x$ac_enable_64bit" = "xyes"],[
 
-    AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
-      LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
-    ])
+      AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
+        LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
+      ])
 
-    AS_IF([test "x$ac_enable_64bit" = "xyes"],[
       AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
        dnl The user hasn't overridden the default libdir, so we'll 
        dnl the dir suffix to match solaris 32/64-bit policy
        libdir="${libdir}/${isainfo_k}"
       ])
 
-      CPPFLAGS="-m64 ${CPPFLAGS}"
-      LDFLAGS="-m64 ${LDFLAGS}"
+      AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
+        CFLAGS="${CFLAGS} -m64"
+        ac_cv_env_CFLAGS_set=set
+        ac_cv_env_CFLAGS_value='-m64'
+      ])
+      AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
+        CXXFLAGS="${CXXFLAGS} -m64"
+        ac_cv_env_CXXFLAGS_set=set
+        ac_cv_env_CXXFLAGS_value='-m64'
+      ])
+
       AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
         AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
         AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
index 90ea6da8a7c1f5dab97640ecc77bc25920217072..0fcaca147b3e279a1907ea0ee5f4a93ec38de50a 100644 (file)
@@ -4,7 +4,7 @@ dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Which version of the canonical setup we're using
-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.22])
+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.61])
 
 AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
   dnl Force dependency tracking on for Sun Studio builds
@@ -23,6 +23,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   m4_define([PCT_REQUIRE_CXX],[no])
   m4_define([PCT_IGNORE_SHARED_PTR],[no])
   m4_define([PCT_FORCE_GCC42],[no])
+  m4_define([PCT_SRC_IN_SRC],[no])
   m4_foreach([pct_arg],[$*],[
     m4_case(pct_arg,
       [use-gnulib], [
@@ -40,6 +41,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
       [force-gcc42], [
         m4_undefine([PCT_FORCE_GCC42])
         m4_define([PCT_FORCE_GCC42],[yes])
+      ],
+      [src-in-src], [
+        m4_undefine([PCT_SRC_IN_SRC])
+        m4_define([PCT_SRC_IN_SRC],[yes])
     ])
   ])
 
@@ -54,6 +59,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   AC_CANONICAL_TARGET
   
   AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects)
+  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
   m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
   
@@ -63,19 +69,16 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
 
   dnl Once we can use a modern autoconf, we can use this
   dnl AC_PROG_CC_C99
-  AC_PROG_CXX
-  AC_PROG_CPP
+  AC_REQUIRE([AC_PROG_CXX])
+  PANDORA_EXTENSIONS
   AM_PROG_CC_C_O
 
 
-  gl_USE_SYSTEM_EXTENSIONS
   m4_if(PCT_FORCE_GCC42, [yes], [
     AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
   ])
 
-  AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
-  AC_CHECK_DECL([__ICC], [INTELCC="yes"], [INTELCC="no"])
-  AS_IF([test "x$INTELCC" = "xyes"], [enable_rpath=no])
+  PANDORA_PLATFORM
 
   PANDORA_LIBTOOL
 
@@ -96,7 +99,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     ])
   ])
   
-  m4_if(PCT_USE_GNULIB, [yes], [gl_INIT])
+  m4_if(PCT_USE_GNULIB, [yes], [
+    gl_INIT
+    AC_CONFIG_LIBOBJ_DIR([gnulib])
+  ])
 
   AC_C_BIGENDIAN
   AC_C_CONST
@@ -139,6 +145,12 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     AM_CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${AM_CPPFLAGS}"
     ])
   ])
+  AS_IF([test "PCT_SRC_IN_SRC" = "yes"],[
+    AM_CPPFLAGS="-I\$(top_srcdir)/src -I\$(top_builddir)/src ${AM_CPPFLAGS}"
+  ])
+
+  PANDORA_USE_PIPE
+
 
   AM_CPPFLAGS="-I\${top_srcdir} -I\${top_builddir} ${AM_CPPFLAGS}"
   AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
index e1f82da088225eafbf4883d57285ba0d668441d4..18c2d6483c4eccdc896277386c9fd590d4953c56 100644 (file)
@@ -17,6 +17,7 @@ AC_DEFUN([PANDORA_ENABLE_DTRACE],[
     AC_CHECK_PROGS([DTRACE], [dtrace])
     AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[
       AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
+      AC_MSG_CHECKING([if dtrace should instrument object files])
       dnl DTrace on MacOSX does not use -G option
       cat >conftest.d <<_ACEOF
 provider Example {
@@ -24,9 +25,10 @@ provider Example {
 };
 _ACEOF
       $DTRACE -G -o conftest.d.o -s conftest.d 2>/dev/zero
-      AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes])
+      AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes],
+            [ac_cv_dtrace_needs_objects=no])
       rm -f conftest.d.o conftest.d
-
+      AC_MSG_RESULT($ac_cv_dtrace_needs_objects)
       AC_SUBST(DTRACEFLAGS) dnl TODO: test for -G on OSX
       ac_cv_have_dtrace=yes
     ])])
index 608a552776dccce0d36a481373302b53f0b42377..d8e28d8c9ea352f02785f3e506304a55b916ac26 100644 (file)
@@ -8,12 +8,15 @@ dnl You're gonna get 4.2.
 AC_DEFUN([PANDORA_MAC_GCC42],
   [AS_IF([test "$GCC" = "yes"],[
     AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[
-      AS_IF([test -f /usr/bin/gcc-4.2],
+      host_os_version=`echo ${host_os} | perl -ple 's/^\D+//g;s,\..*,,'`
+      AS_IF([test "$host_os_version" -lt 10],[
+        AS_IF([test -f /usr/bin/gcc-4.2],
         [
           CPP="/usr/bin/gcc-4.2 -E"
           CC=/usr/bin/gcc-4.2
           CXX=/usr/bin/g++-4.2
         ])
+      ])
     ])
   ])
 ])
diff --git a/m4/pandora_extensions.m4 b/m4/pandora_extensions.m4
new file mode 100644 (file)
index 0000000..ee73b80
--- /dev/null
@@ -0,0 +1,16 @@
+dnl  Copyright (C) 2009 Sun Microsystems
+dnl This file is free software; Sun Microsystems
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([PANDORA_EXTENSIONS],[
+
+  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+    [AC_REQUIRE([AC_GNU_SOURCE])])
+
+])
+
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],[
+  AC_REQUIRE([PANDORA_EXTENSIONS])
+])
index 4563e3b5496298f6f27464c7d998e7098152ea12..18b474806331984b7818a96d8d6e66e970105920 100644 (file)
@@ -11,8 +11,16 @@ AC_DEFUN([PANDORA_HAVE_BETTER_MALLOC],[
   AC_ARG_ENABLE([umem],
     [AS_HELP_STRING([--enable-umem],
        [Enable linking with libumem @<:@default=off@:>@])],
-    [ac_enable_umem="$enableval"],
-    [ac_enable_umem="no"])
+    [ac_enable_umem="$enableval"],[
+      case "$target_os" in
+        *solaris*)
+          ac_enable_umem="yes"
+        ;;
+        *)
+          ac_enable_umem="no"
+        ;;
+      esac
+    ])
   
   AC_ARG_ENABLE([tcmalloc],
     [AS_HELP_STRING([--enable-tcmalloc],
index ea86dd160d9525f67cb031d723084b13b34b33e2..218d1fad37f8ae49fc68d4410d11964f14789a69 100644 (file)
@@ -9,16 +9,25 @@ AC_DEFUN([_PANDORA_SEARCH_LIBDRIZZLE],[
   dnl --------------------------------------------------------------------
   dnl  Check for libdrizzle
   dnl --------------------------------------------------------------------
-  
-  AC_LIB_HAVE_LINKFLAGS(drizzle,,[
-    #include <libdrizzle/drizzle_client.h>
+
+  AC_ARG_ENABLE([libdrizzle],
+    [AS_HELP_STRING([--disable-libdrizzle],
+      [Build with libdrizzle support @<:@default=on@:>@])],
+    [ac_enable_libdrizzle="$enableval"],
+    [ac_enable_libdrizzle="yes"])
+
+  AS_IF([test "x$ac_enable_libdrizzle" = "xyes"],[
+    AC_LIB_HAVE_LINKFLAGS(drizzle,,[
+      #include <libdrizzle/drizzle_client.h>
+    ],[
+      drizzle_st drizzle;
+      drizzle_version();
+    ])
   ],[
-    drizzle_st drizzle;
-    drizzle_version();
+    ac_cv_libdrizzle="no"
   ])
   
   AM_CONDITIONAL(HAVE_LIBDRIZZLE, [test "x${ac_cv_libdrizzle}" = "xyes"])
-
 ])
 
 AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
@@ -27,7 +36,7 @@ AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
 
 AC_DEFUN([PANDORA_REQUIRE_LIBDRIZZLE],[
   AC_REQUIRE([PANDORA_HAVE_LIBDRIZZLE])
-  AS_IF([test x$ac_cv_libdrizzle = xno],
+  AS_IF([test "x${ac_cv_libdrizzle}" = "xno"],
       AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}]))
 ])
 
index fc0def74595d3ef06c0a228ce4f539b87a79e255..2387bed9bc52dbe125ed07d14dffbe85bf4895c8 100644 (file)
@@ -10,14 +10,24 @@ AC_DEFUN([_PANDORA_SEARCH_LIBGEARMAN],[
   dnl  Check for libgearman
   dnl --------------------------------------------------------------------
 
-  AC_LIB_HAVE_LINKFLAGS(gearman,, 
-    [#include <libgearman/gearman.h>],[ 
-      gearman_client_st gearman_client; 
-      gearman_version(); 
-    ]) 
+  AC_ARG_ENABLE([libgearman],
+    [AS_HELP_STRING([--disable-libgearman],
+      [Build with libgearman support @<:@default=on@:>@])],
+    [ac_enable_libgearman="$enableval"],
+    [ac_enable_libgearman="yes"])
+
+  AS_IF([test "x$ac_enable_libgearman" = "xyes"],[
+    AC_LIB_HAVE_LINKFLAGS(gearman,,[
+      #include <libgearman/gearman.h>
+    ],[
+      gearman_client_st gearman_client;
+      gearman_version();
+    ])
+  ],[
+    ac_cv_libgearman="no"
+  ])
 
   AM_CONDITIONAL(HAVE_LIBGEARMAN, [test "x${ac_cv_libgearman}" = "xyes"])
-  
 ])
 
 AC_DEFUN([PANDORA_HAVE_LIBGEARMAN],[
@@ -26,6 +36,6 @@ AC_DEFUN([PANDORA_HAVE_LIBGEARMAN],[
 
 AC_DEFUN([PANDORA_REQUIRE_LIBGEARMAN],[
   AC_REQUIRE([PANDORA_HAVE_LIBGEARMAN])
-  AS_IF([test x$ac_cv_libgearman = xno],
+  AS_IF([test "x${ac_cv_libgearman}" = "xno"],
       AC_MSG_ERROR([libgearman is required for ${PACKAGE}]))
 ])
index d4bebf53eb508b29ac3ea61e1ce119e3f4372cbb..d1a44c60e04c5cbf512f16a72e673839d2384c9c 100644 (file)
@@ -10,18 +10,27 @@ AC_DEFUN([_PANDORA_SEARCH_LIBMEMCACHED],[
   dnl  Check for libmemcached
   dnl --------------------------------------------------------------------
 
-  AC_LIB_HAVE_LINKFLAGS(memcached,,[
-    #include <libmemcached/memcached.h>
-  ], [
-    memcached_st memc;
-    memcached_dump_func *df;
-    memcached_version();
+  AC_ARG_ENABLE([libmemcached],
+    [AS_HELP_STRING([--disable-libmemcached],
+      [Build with libmemcached support @<:@default=on@:>@])],
+    [ac_enable_libmemcached="$enableval"],
+    [ac_enable_libmemcached="yes"])
+
+  AS_IF([test "x$ac_enable_libmemcached" = "xyes"],[
+    AC_LIB_HAVE_LINKFLAGS(memcached,,[
+      #include <libmemcached/memcached.h>
+    ],[
+      memcached_st memc;
+      memcached_dump_func *df;
+      memcached_lib_version();
+    ])
+  ],[
+    ac_cv_libmemcached="no"
   ])
   
   AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
   
   AS_IF([test "x${ac_cv_libmemcached}" = "xyes"], [ PANDORA_WITH_MEMCACHED ])
-
 ])
 
 AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
index 86ccb49520cfdab1e71b4012feb5237596552d8b..3812dc594496226501813ab42d263c2f88734bcb 100644 (file)
@@ -10,11 +10,26 @@ AC_DEFUN([_PANDORA_SEARCH_LIBPQ],[
   dnl  Check for libpq
   dnl --------------------------------------------------------------------
 
-  AC_LIB_HAVE_LINKFLAGS(pq,,[
-    #include <libpq-fe.h>
-  ], [
-    PGconn *conn;
-    conn = PQconnectdb(NULL);
+  AC_ARG_ENABLE([libpq],
+    [AS_HELP_STRING([--disable-libpq],
+      [Build with libpq support @<:@default=on@:>@])],
+    [ac_enable_libpq="$enableval"],
+    [ac_enable_libpq="yes"])
+
+  AS_IF([test "x$ac_enable_libpq" = "xyes"],[
+    AC_CHECK_HEADERS([libpq-fe.h])
+    AC_LIB_HAVE_LINKFLAGS(pq,,[
+      #ifdef HAVE_LIBPQ_FE_H
+      # include <libpq-fe.h>
+      #else
+      # include <postgresql/libpq-fe.h>
+      #endif
+    ], [
+      PGconn *conn;
+      conn = PQconnectdb(NULL);
+    ])
+  ],[
+    ac_cv_libpq="no"
   ])
   
   AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
@@ -26,6 +41,6 @@ AC_DEFUN([PANDORA_HAVE_LIBPQ],[
 
 AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
   AC_REQUIRE([PANDORA_HAVE_LIBPQ])
-  AS_IF([test x$ac_cv_libpq = xno],
-      AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
+  AS_IF([test "x${ac_cv_libpq}" = "xno"],
+    AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
 ])
diff --git a/m4/pandora_have_libsqlite3.m4 b/m4/pandora_have_libsqlite3.m4
new file mode 100644 (file)
index 0000000..15e0195
--- /dev/null
@@ -0,0 +1,42 @@
+dnl  Copyright (C) 2009 Sun Microsystems
+dnl This file is free software; Sun Microsystems
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([_PANDORA_SEARCH_LIBSQLITE3],[
+  AC_REQUIRE([AC_LIB_PREFIX])
+
+  dnl --------------------------------------------------------------------
+  dnl  Check for libsqlite3
+  dnl --------------------------------------------------------------------
+
+  AC_ARG_ENABLE([libsqlite3],
+    [AS_HELP_STRING([--disable-libsqlite3],
+      [Build with libsqlite3 support @<:@default=on@:>@])],
+    [ac_enable_libsqlite3="$enableval"],
+    [ac_enable_libsqlite3="yes"])
+
+  AS_IF([test "x$ac_enable_libsqlite3" = "xyes"],[
+    AC_LIB_HAVE_LINKFLAGS(sqlite3,,[
+      #include <stdio.h>
+      #include <sqlite3.h>
+    ],[
+      sqlite3 *db;
+      sqlite3_open(NULL, &db);
+    ])
+  ],[
+    ac_cv_libsqlite3="no"
+  ])
+
+  AM_CONDITIONAL(HAVE_LIBSQLITE3, [test "x${ac_cv_libsqlite3}" = "xyes"])
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBSQLITE3],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBSQLITE3],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
+  AS_IF([test "x${ac_cv_libsqlite3}" = "xno"],
+    AC_MSG_ERROR([libsqlite3 is required for ${PACKAGE}]))
+])
diff --git a/m4/pandora_have_protobuf.m4 b/m4/pandora_have_protobuf.m4
new file mode 100644 (file)
index 0000000..3b1652e
--- /dev/null
@@ -0,0 +1,80 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+dnl --------------------------------------------------------------------
+dnl  Check for Google Proto Buffers
+dnl --------------------------------------------------------------------
+
+AC_DEFUN([_PANDORA_SEARCH_LIBPROTOBUF],[
+  AC_REQUIRE([PANDORA_HAVE_PTHREAD])
+
+  AC_LANG_PUSH([C++])
+  save_CXXFLAGS="${CXXFLAGS}"
+  CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}"
+  AC_LIB_HAVE_LINKFLAGS(protobuf,,
+    [#include <google/protobuf/descriptor.h>],
+    [google::protobuf::FileDescriptor* file;],
+    [system])
+  CXXFLAGS="${save_CXXFLAGS}"
+  AC_LANG_POP()
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBPROTOBUF],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBPROTOBUF])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBPROTOBUF],[
+  AC_REQUIRE([PANDORA_HAVE_LIBPROTOBUF])
+  AS_IF([test x$ac_cv_libprotobuf = xno],
+      AC_MSG_ERROR([libprotobuf is required for ${PACKAGE}. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.]))
+])
+
+AC_DEFUN([PANDORA_PROTOBUF_REQUIRE_VERSION],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBPROTOBUF])
+  p_recent_ver=$1
+  p_recent_ver_major=`echo $p_recent_ver | cut -f1 -d.`
+  p_recent_ver_minor=`echo $p_recent_ver | cut -f2 -d.`
+  p_recent_ver_patch=`echo $p_recent_ver | cut -f3 -d.`
+  p_recent_ver_hex=`printf "%d%03d%03d" $p_recent_ver_major $p_recent_ver_minor $p_recent_ver_patch` 
+  AC_LANG_PUSH([C++])
+  AC_CACHE_CHECK([for protobuf >= $p_recent_ver],
+    [drizzle_cv_protobuf_recent],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <google/protobuf/descriptor.h>
+#if GOOGLE_PROTOBUF_VERSION < $p_recent_ver_hex
+# error Your version of Protobuf is too old
+#endif
+      ]])],
+    [drizzle_cv_protobuf_recent=yes],
+    [drizzle_cv_protobuf_recent=no])])
+  AS_IF([test "$drizzle_cv_protobuf_recent" = "no"],[
+    AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. ${PACKAGE} requires at least version $p_recent_ver])
+  ])
+  AC_LANG_POP()
+])
+
+AC_DEFUN([_PANDORA_SEARCH_PROTOC],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBPROTOBUF])
+  AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
+])
+
+AC_DEFUN([PANDORA_HAVE_PROTOC],[
+  AC_REQUIRE([_PANDORA_SEARCH_PROTOC])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_PROTOC],[
+  AC_REQUIRE([PANDORA_HAVE_PROTOC])
+  AS_IF([test "x$PROTOC" = "xno"],[
+    AC_MSG_ERROR([Couldn't find the protoc compiler. On Debian this can be found in protobuf-compiler. On RedHat this can be found in protobuf-compiler.])
+  ])
+])
+
+
diff --git a/m4/pandora_have_sqlite.m4 b/m4/pandora_have_sqlite.m4
deleted file mode 100644 (file)
index 8cfaddd..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems
-dnl This file is free software; Sun Microsystems
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-
-AC_DEFUN([_PANDORA_SEARCH_SQLITE],[
-  AC_REQUIRE([AC_LIB_PREFIX])
-
-  AC_LIB_HAVE_LINKFLAGS(sqlite3,,[
-    #include <stdio.h>
-    #include <sqlite3.h>
-  ],[
-    sqlite3 *db;
-    sqlite3_open(NULL, &db);
-  ])
-
-  AM_CONDITIONAL(HAVE_LIBSQLITE3, [test "x${ac_cv_libsqlite3}" = "xyes"])
-
-])
-
-AC_DEFUN([PANDORA_HAVE_SQLITE],[
-  AC_REQUIRE([_PANDORA_SEARCH_SQLITE])
-])
diff --git a/m4/pandora_platform.m4 b/m4/pandora_platform.m4
new file mode 100644 (file)
index 0000000..c4f2b2a
--- /dev/null
@@ -0,0 +1,77 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+AC_DEFUN([PANDORA_PLATFORM],[
+
+  dnl Canonicalize the configuration name.
+
+  AC_DEFINE_UNQUOTED([HOST_VENDOR], ["$host_vendor"],[Vendor of Build System])
+  AC_DEFINE_UNQUOTED([HOST_OS], ["$host_os"], [OS of Build System])
+  AC_DEFINE_UNQUOTED([HOST_CPU], ["$host_cpu"], [CPU of Build System])
+
+  AC_DEFINE_UNQUOTED([TARGET_VENDOR], ["$target_vendor"],[Vendor of Target System])
+  AC_DEFINE_UNQUOTED([TARGET_OS], ["$target_os"], [OS of Target System])
+  AC_DEFINE_UNQUOTED([TARGET_CPU], ["$target_cpu"], [CPU of Target System])
+
+
+  case "$host_os" in
+    *solaris*|*freebsd*)
+    AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[
+      CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
+    ])
+
+    AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
+      LDFLAGS="${LDFLAGS} -L/usr/local/lib"
+    ])
+    ;;
+  esac
+
+  case "$target_os" in
+    *linux*)
+    TARGET_LINUX="true"
+    AC_SUBST(TARGET_LINUX)
+    AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
+      ;;
+    *darwin*)
+      TARGET_OSX="true"
+      AC_SUBST(TARGET_OSX)
+      AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
+      ;;
+    *solaris*)
+      TARGET_SOLARIS="true"
+      AC_SUBST(TARGET_SOLARIS)
+      AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
+      ;;
+    *freebsd*)
+      TARGET_FREEBSD="true"
+      AC_SUBST(TARGET_FREEBSD)
+      AC_DEFINE([TARGET_OS_FREEBSD], [1], [Whether we are building for FreeBSD])
+      AC_DEFINE([__APPLE_CC__],[1],[Workaround for bug in FreeBSD headers])
+      ;;
+    *)
+      ;;
+  esac
+
+  AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+  AC_CHECK_DECL([__ICC], [INTELCC="yes"], [INTELCC="no"])
+
+  AS_IF([test "$INTELCC" = "yes"], [enable_rpath=no])
+  dnl By default, Sun Studio grabs special versions of limits.h and string.h
+  dnl when you use <cstring> and <climits>. By setting this define, we can
+  dnl disable that and cause those to wrap the standard headers instead.
+  dnl http://www.stlport.com/doc/configure.html
+  AS_IF([test "$SUNCC" = "yes"],[
+    AC_DEFINE([_STLP_NO_NEW_C_HEADERS],[1],
+      [Cause Sun Studio to not be quite so strict with standards conflicts])
+  ])
+
+])
diff --git a/m4/pandora_plugins.m4 b/m4/pandora_plugins.m4
new file mode 100644 (file)
index 0000000..75e3732
--- /dev/null
@@ -0,0 +1,41 @@
+dnl  Copyright (C) 2009 Sun Microsystems
+dnl This file is free software; Sun Microsystems
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl--------------------------------------------------------------------
+dnl PANDORA_PLUGINS
+dnl Declare our plugin modules
+dnl--------------------------------------------------------------------
+
+AC_DEFUN([PANDORA_PLUGINS],[
+
+  m4_sinclude(config/plugin.ac)
+  dnl Add code here to read set plugin lists and  set drizzled_default_plugin_list
+  AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list],
+                     [List of plugins that should be loaded on startup if no
+                      value is given for --plugin-load])
+
+  pandora_builtin_list=`echo $pandora_builtin_list | sed 's/, *$//'`
+  AS_IF([test "x$pandora_builtin_list" = "x"], pandora_builtin_list="NULL")
+  AC_SUBST([PANDORA_BUILTIN_LIST],[$pandora_builtin_list])
+  m4_ifval(m4_normalize([$1]),[
+    AC_CONFIG_FILES($*)
+    ],[
+    AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],[$pandora_builtin_list],
+                       [List of plugins to be built in])
+  ])
+
+
+  AC_SUBST(pandora_plugin_test_list)
+  AC_SUBST(pandora_plugin_libs)
+
+  pandora_plugin_defs=`echo $pandora_plugin_defs | sed 's/, *$//'`
+  AC_SUBST(pandora_plugin_defs)
+
+  AC_SUBST(PANDORA_PLUGIN_DEP_LIBS)
+  AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
+])
+
+AC_DEFUN([PANDORA_ADD_PLUGIN_DEP_LIB],[
+  PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} $*"
+])
diff --git a/m4/pandora_pthread.m4 b/m4/pandora_pthread.m4
new file mode 100644 (file)
index 0000000..78af2ba
--- /dev/null
@@ -0,0 +1,78 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+
+dnl --------------------------------------------------------------------
+dnl  Check for libpthread
+dnl --------------------------------------------------------------------
+
+AC_DEFUN([PANDORA_PTHREAD_YIELD],[
+  AC_REQUIRE([ACX_PTHREAD])
+
+  save_CFLAGS="${CFLAGS}"
+  save_CXXFLAGS="${CXXFLAGS}"
+  CFLAGS="${PTHREAD_CFLAGS} ${CFLAGS}"
+  CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}"
+  dnl Some OSes like Mac OS X have that as a replacement for pthread_yield()
+  AC_CHECK_FUNCS(pthread_yield_np)
+  AC_CACHE_CHECK([if pthread_yield takes zero arguments],
+    [pandora_cv_pthread_yield_zero_arg],
+    [AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([[
+#include <pthread.h>
+        ]],[[
+  pthread_yield();
+        ]])],
+      [pandora_cv_pthread_yield_zero_arg=yes],
+      [pandora_cv_pthread_yield_zero_arg=no])])
+  AS_IF([test "$pandora_cv_pthread_yield_zero_arg" = "yes"],[
+    AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
+              [pthread_yield that doesn't take any arguments])
+  ])
+
+  AC_CACHE_CHECK([if pthread_yield takes one argument],
+    [pandora_cv_pthread_yield_one_arg],
+    [AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([[
+#include <pthread.h>
+        ]],[[
+  pthread_yield(0);
+        ]])],
+      [pandora_cv_pthread_yield_one_arg=yes],
+      [pandora_cv_pthread_yield_one_arg=no])])
+  AS_IF([test "$pandora_cv_pthread_yield_one_arg" = "yes"],[
+    AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
+              [pthread_yield function with one argument])
+  ])
+
+  CFLAGS="${save_CFLAGS}"
+  CXXFLAGS="${save_CXXFLAGS}"
+])
+
+
+AC_DEFUN([_PANDORA_SEARCH_PTHREAD],[
+  AC_REQUIRE([ACX_PTHREAD])
+  LIBS="${PTHREAD_LIBS} ${LIBS}"
+  AM_CFLAGS="${PTHREAD_CFLAGS} ${AM_CFLAGS}"
+  AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
+  PANDORA_PTHREAD_YIELD
+])
+
+
+AC_DEFUN([PANDORA_HAVE_PTHREAD],[
+  AC_REQUIRE([_PANDORA_SEARCH_PTHREAD])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_PTHREAD],[
+  AC_REQUIRE([PANDORA_HAVE_PTHREAD])
+  AS_IF([test "x$acx_pthread_ok" != "xyes"],[
+    AC_MSG_ERROR(could not find libpthread)])
+])
diff --git a/m4/pandora_python3_devel.m4 b/m4/pandora_python3_devel.m4
new file mode 100644 (file)
index 0000000..7712ef1
--- /dev/null
@@ -0,0 +1,236 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl
+dnl   Copyright (C) 2009 Sun Microsystems, Inc.
+dnl   Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+dnl   Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+dnl   Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+dnl   Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+dnl   Copyright (c) 2008 Matteo Settenvini <matteo@member.fsf.org>
+dnl   Copyright (c) 2008 Horst Knorr <hk_classes@knoda.org>
+dnl
+dnl   This program is free software: you can redistribute it and/or modify it
+dnl   under the terms of the GNU General Public License as published by the
+dnl   Free Software Foundation, either version 3 of the License, or (at your
+dnl   option) any later version.
+dnl
+dnl   This program is distributed in the hope that it will be useful, but
+dnl   WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+dnl   Public License for more details.
+dnl
+dnl   You should have received a copy of the GNU General Public License along
+dnl   with this program. If not, see <http://www.gnu.org/licenses/>.
+dnl
+dnl   As a special exception, the respective Autoconf Macro's copyright owner
+dnl   gives unlimited permission to copy, distribute and modify the configure
+dnl   scripts that are the output of Autoconf when processing the Macro. You
+dnl   need not follow the terms of the GNU General Public License when using
+dnl   or distributing such scripts, even though portions of the text of the
+dnl   Macro appear in them. The GNU General Public License (GPL) does govern
+dnl   all other use of the material that constitutes the Autoconf Macro.
+dnl
+dnl   This special exception to the GPL applies to versions of the Autoconf
+dnl   Macro released by the Autoconf Macro Archive. When you make and
+dnl   distribute a modified version of the Autoconf Macro, you may extend this
+dnl   special exception to the GPL to apply to your modified version as well.
+
+dnl SYNOPSIS
+dnl
+dnl   PANDORA_PYTHON3_DEVEL([version])
+dnl
+dnl DESCRIPTION
+dnl
+dnl   Note: Defines as a precious variable "PYTHON3_VERSION". Don't override it
+dnl   in your configure.ac.
+dnl
+dnl   This macro checks for Python and tries to get the include path to
+dnl   'Python.h'. It provides the $(PYTHON3_CPPFLAGS) and $(PYTHON3_LDFLAGS)
+dnl   output variables. It also exports $(PYTHON3_EXTRA_LIBS) and
+dnl   $(PYTHON3_EXTRA_LDFLAGS) for embedding Python in your code.
+dnl
+dnl   You can search for some particular version of Python by passing a
+dnl   parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
+dnl   note that you *have* to pass also an operator along with the version to
+dnl   match, and pay special attention to the single quotes surrounding the
+dnl   version number. Don't use "PYTHON3_VERSION" for this: that environment
+dnl   variable is declared as precious and thus reserved for the end-user.
+dnl
+dnl LAST MODIFICATION
+dnl
+dnl   2009-08-23
+
+AC_DEFUN([PANDORA_PYTHON3_DEVEL],[
+       #
+       # Allow the use of a (user set) custom python version
+       #
+       AC_ARG_VAR([PYTHON3_VERSION],[The installed Python
+               version to use, for example '3.0'. This string
+               will be appended to the Python interpreter
+               canonical name.])
+
+
+  AS_IF([test -z "$PYTHON3"],[
+       AC_PATH_PROG([PYTHON3],[python[$PYTHON3_VERSION]])
+  ])
+       AS_IF([test -z "$PYTHON3"],[
+         AC_MSG_ERROR([Cannot find python$PYTHON3_VERSION in your system path])
+         PYTHON3_VERSION=""
+  ])
+
+       #
+       # if the macro parameter ``version'' is set, honour it
+       #
+       if test -n "$1"; then
+               AC_MSG_CHECKING([for a version of Python $1])
+               ac_supports_python3_ver=`$PYTHON3 -c "import sys, string; \
+                       ver = string.split(sys.version)[[0]]; \
+                       print(ver $1)"`
+               if test "$ac_supports_python3_ver" = "True"; then
+                  AC_MSG_RESULT([yes])
+               else
+                       AC_MSG_RESULT([no])
+                       AC_MSG_ERROR([this package requires Python $1.
+If you have it installed, but it isn't the default Python
+interpreter in your system path, please pass the PYTHON3_VERSION
+variable to configure. See ``configure --help'' for reference.
+])
+                       PYTHON_VERSION=""
+               fi
+       fi
+
+       #
+       # Check if you have distutils, else fail
+       #
+       AC_MSG_CHECKING([for Python3 distutils package])
+       ac_python3_distutils_result=`$PYTHON3 -c "import distutils" 2>&1`
+       if test -z "$ac_python3_distutils_result"; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               AC_MSG_ERROR([cannot import Python3 module "distutils".
+Please check your Python3 installation. The error was:
+$ac_python3_distutils_result])
+               PYTHON3_VERSION=""
+       fi
+
+       #
+       # Check for Python include path
+       #
+       AC_MSG_CHECKING([for Python3 include path])
+       if test -z "$PYTHON3_CPPFLAGS"; then
+               python3_path=`$PYTHON3 -c "import distutils.sysconfig; \
+                       print(distutils.sysconfig.get_python_inc());"`
+               if test -n "${python3_path}"; then
+                       python3_path="-I$python3_path"
+               fi
+               PYTHON3_CPPFLAGS=$python3_path
+       fi
+       AC_MSG_RESULT([$PYTHON3_CPPFLAGS])
+       AC_SUBST([PYTHON3_CPPFLAGS])
+
+       #
+       # Check for Python library path
+       #
+       AC_MSG_CHECKING([for Python3 library path])
+       if test -z "$PYTHON3_LDFLAGS"; then
+               # (makes two attempts to ensure we've got a version number
+               # from the interpreter)
+               py3_version=`$PYTHON3 -c "from distutils.sysconfig import *; \
+                       print(' '.join(get_config_vars('VERSION')))"`
+               if test "$py3_version" == "[None]"; then
+                       if test -n "$PYTHON3_VERSION"; then
+                               py3_version=$PYTHON3_VERSION
+                       else
+                               py3_version=`$PYTHON3 -c "import sys; \
+                                       print(sys.version[[:3]])"`
+                       fi
+               fi
+
+               PYTHON3_LDFLAGS=`$PYTHON3 -c "from distutils.sysconfig import *; \
+                       print('-L' + get_python_lib(0,1), \
+                       '-lpython');"`$py3_version
+       fi
+       AC_MSG_RESULT([$PYTHON3_LDFLAGS])
+       AC_SUBST([PYTHON3_LDFLAGS])
+
+       #
+       # Check for site packages
+       #
+       AC_MSG_CHECKING([for Python3 site-packages path])
+       if test -z "$PYTHON3_SITE_PKG"; then
+               PYTHON3_SITE_PKG=`$PYTHON3 -c "import distutils.sysconfig; \
+                       print(distutils.sysconfig.get_python_lib(0,0));"`
+       fi
+       AC_MSG_RESULT([$PYTHON3_SITE_PKG])
+       AC_SUBST([PYTHON3_SITE_PKG])
+
+       #
+       # libraries which must be linked in when embedding
+       #
+       AC_MSG_CHECKING(for Python3 embedding libraries)
+       if test -z "$PYTHON3_EMBED_LIBS"; then
+          PYTHON3_EMBED_LIBS=`$PYTHON3 -c "import distutils.sysconfig; \
+                conf = distutils.sysconfig.get_config_var; \
+                print(conf('LOCALMODLIBS'), conf('LIBS'))"`
+       fi
+       AC_MSG_RESULT([$PYTHON3_EMBED_LIBS])
+       AC_SUBST(PYTHON3_EMBED_LIBS)
+
+       #
+       # linking flags needed when embedding
+       #
+       AC_MSG_CHECKING(for Python3 embedding linking flags)
+       if test -z "$PYTHON3_EMBED_LDFLAGS"; then
+               PYTHON3_EMBED_LDFLAGS=`$PYTHON3 -c "import distutils.sysconfig; \
+                       conf = distutils.sysconfig.get_config_var; \
+                       print(conf('LINKFORSHARED'))"`
+       fi
+       AC_MSG_RESULT([$PYTHON3_EMBED_LDFLAGS])
+       AC_SUBST(PYTHON3_EMBED_LDFLAGS)
+
+       #
+       # final check to see if everything compiles alright
+       #
+       AC_MSG_CHECKING([for Python3 development environment consistency])
+       AC_LANG_PUSH([C])
+       # save current global flags
+  ac_save_LIBS="$LIBS"
+  ac_save_CPPFLAGS="$CPPFLAGS"
+       LIBS="$ac_save_LIBS $PYTHON3_LDFLAGS"
+       CPPFLAGS="$ac_save_CPPFLAGS $PYTHON3_CPPFLAGS"
+       AC_TRY_LINK([
+               #include <Python.h>
+       ],[
+               Py_Initialize();
+       ],[python3exists=yes],[python3exists=no])
+
+       AC_MSG_RESULT([$python3exists])
+
+        if test ! "$python3exists" = "yes"; then
+          AC_MSG_WARN([
+  Could not link test program to Python3.
+  Maybe the main Python3 library has been installed in some non-standard
+  library path. If so, pass it to configure, via the LDFLAGS environment
+  variable.
+  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python3/lib"
+  ============================================================================
+   ERROR!
+   You probably have to install the development version of the Python3 package
+   for your distribution.  The exact name of this package varies among them.
+  ============================================================================
+          ])
+         PYTHON3_VERSION=""
+       fi
+       AC_LANG_POP
+       # turn back to default flags
+       CPPFLAGS="$ac_save_CPPFLAGS"
+       LIBS="$ac_save_LIBS"
+
+       #
+       # all done!
+       #
+])
+
diff --git a/m4/pandora_swig.m4 b/m4/pandora_swig.m4
new file mode 100644 (file)
index 0000000..fe91b08
--- /dev/null
@@ -0,0 +1,39 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+AC_DEFUN([PANDORA_SWIG],[
+
+  AC_PROG_SWIG(1.3.31)
+  
+  AC_DEFINE_UNQUOTED([SWIG_TYPE_TABLE],
+    [$PACKAGE],
+    [Type Table name for SWIG symbol table])
+
+  dnl Have to hard-code /usr/local/include and /usr/include into the path.
+  dnl I hate this. Why is swig sucking me
+  SWIG="$SWIG \${DEFS} -I\${top_srcdir} -I\${top_builddir} -I/usr/local/include -I/usr/include"
+  AC_SUBST([SWIG])
+
+
+])
+
+AC_DEFUN([PANDORA_SWIG_PYTHON3],[
+  AC_REQUIRE([PANDORA_SWIG])
+  AS_IF([test "x$SWIG" != "x"],[
+    AC_CACHE_CHECK([if swig supports Python3],
+      [ac_cv_swig_has_python3_],
+      [
+        AS_IF([$SWIG -python -help 2>&1 | grep py3 > /dev/null],
+          [ac_cv_swig_has_python3_=yes],
+          [ac_cv_swig_has_python3_=no])
+      ])
+  ])
+])
diff --git a/m4/pandora_use_pipe.m4 b/m4/pandora_use_pipe.m4
new file mode 100644 (file)
index 0000000..8e8c28a
--- /dev/null
@@ -0,0 +1,36 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+dnl
+dnl Test if we can Use -pipe to avoid making temp files during the compile.
+dnl Should speed up compile on slower disks
+
+AC_DEFUN([PANDORA_USE_PIPE],[
+
+  AS_IF([test "$GCC" = "yes"],[
+    AC_CACHE_CHECK([for working -pipe], [pandora_cv_use_pipe], [
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+  (void) argc; (void) argv;
+  return 0;
+}
+      ]])],
+      [pandora_cv_use_pipe=yes],
+      [pandora_cv_use_pipe=no])
+    ])
+    AS_IF([test "$pandora_cv_use_pipe" = "yes"],[
+      AM_CFLAGS="-pipe ${AM_CFLAGS}"
+      AM_CXXFLAGS="-pipe ${AM_CXXFLAGS}"
+    ])
+  ])
+])
index ada6ccf6c693f7e66419ac403356745b7ffad330..d84b96767f3b499619c57c8e677eb2433c1e16ed 100644 (file)
@@ -28,5 +28,30 @@ AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
     ac_cv_building_from_hg=no
   ])
 
+  AS_IF([test -d "${srcdir}/.git"],[
+    ac_cv_building_from_git=yes
+    ac_cv_building_from_vc=yes
+    ],[
+    ac_cv_building_from_git=no
+  ])
+
+
 ])
   
+dnl Takes one argument which is the prefix to append
+AC_DEFUN([PANDORA_EXPORT_BZR_INFO],[
+  m4_ifval(m4_normalize([$1]),[
+    m4_define([PEBI_PREFIX],[])
+  ],[
+    m4_define([PEBI_PREFIX],m4_toupper(m4_normalize($1))[_])
+  ])
+
+  AC_DEFINE(PEBI_PREFIX[BZR_REVID], ["BZR_REVID"], [bzr revision ID])
+  AC_DEFINE(PEBI_PREFIX[BZR_BRANCH], ["BZR_BRANCH"], [bzr branch name])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_DATE], ["RELEASE_DATE"], [Release date based on the date of the repo checkout])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison])
+])
+
index 46d752eab63883fcc3611076d72fef40cf85219c..7241ba7cb9d7f611951d9bdc6511e3add4efa29b 100644 (file)
@@ -204,9 +204,51 @@ template <> void C<int>::foo();
       AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
             [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
             [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
+
+      AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
+        [ac_cv_safe_to_use_Wattributes_],
+        [AC_LANG_PUSH(C++)
+         save_CXXFLAGS="${CXXFLAGS}"
+         CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
+         AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM([
+#include <google/protobuf/message.h>
+#include <google/protobuf/descriptor.h>
+
+
+const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
+enum Table_TableOptions_RowType {
+  Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
+  Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
+  Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
+  Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
+  Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
+  Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
+  Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
+};
+
+namespace google {
+namespace protobuf {
+template <>
+inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
+  return Table_TableOptions_RowType_descriptor();
+}
+}
+}
+            ])],
+            [ac_cv_safe_to_use_Wattributes_=yes],
+            [ac_cv_safe_to_use_Wattributes_=no])
+          CXXFLAGS="${save_CXXFLAGS}"
+          AC_LANG_POP()])
+      AS_IF([test "$ac_cv_safe_to_use_Wattributes_" = "yes"],
+            [],
+            [CXX_WARNINGS="${CXX_WARNINGS} -Wno-attributes"])
   
       NO_REDUNDANT_DECLS="-Wno-redundant-decls"
-      PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
+      dnl TODO: Figure out a better way to deal with this:
+      PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces -Wno-attributes"
+      NO_WERROR="-Wno-error"
+      INNOBASE_SKIP_WARNINGS="-Wno-shadow -Wno-cast-align"
       
     ])
   ])
@@ -247,8 +289,9 @@ template <> void C<int>::foo();
 
     CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
     CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
-    PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
+    PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
     NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
+    NO_WERROR="-errwarn=%none"
 
   ])
 
@@ -258,5 +301,7 @@ template <> void C<int>::foo();
   AC_SUBST(NO_SHADOW)
   AC_SUBST(NO_STRICT_ALIASING)
   AC_SUBST(PROTOSKIP_WARNINGS)
+  AC_SUBST(INNOBASE_SKIP_WARNINGS)
+  AC_SUBST(NO_WERROR)
 
 ])
diff --git a/m4/pandora_with_lua.m4 b/m4/pandora_with_lua.m4
new file mode 100644 (file)
index 0000000..26af035
--- /dev/null
@@ -0,0 +1,55 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+AC_DEFUN([PANDORA_WITH_LUA],[
+    dnl Check for lua
+    AC_ARG_WITH([lua], 
+    [AS_HELP_STRING([--with-lua],
+      [Build Lua Bindings @<:@default=yes@:>@])],
+    [with_lua=$withval], 
+    [with_lua=yes])
+
+  AS_IF([test "x$with_lua" != "xno"],[
+    AS_IF([test "x$with_lua" = "xyes"],
+      [LUAPC=lua],
+      [LUAPC=$with_lua])
+
+    PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
+      AC_DEFINE([HAVE_LUA], [1], [liblua])
+      AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+      with_lua=yes
+    ],[
+      LUAPC=lua5.1
+      PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
+        AC_DEFINE([HAVE_LUA], [1], [liblua])
+        AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+        with_lua=yes
+      ],[
+        AC_DEFINE([HAVE_LUA],["x"],["x"])
+        with_lua=no
+      ])
+    ])
+
+    AC_CACHE_CHECK([for LUA installation location],[pandora_cv_lua_archdir],[
+      AS_IF([test "$prefix" = "NONE"],[
+        pandora_cv_lua_archdir=`${PKG_CONFIG} --define-variable=prefix=${ac_default_prefix} --variable=INSTALL_CMOD ${LUAPC}`
+      ],[
+        pandora_cv_lua_archdir=`${PKG_CONFIG} --define-variable=prefix=${prefix} --variable=INSTALL_CMOD ${LUAPC}`
+      ])
+    ])
+    LUA_ARCHDIR="${pandora_cv_lua_archdir}"
+    AC_SUBST(LUA_ARCHDIR)
+    AC_SUBST(LUA_CFLAGS)
+    AC_SUBST(LUA_LIBS)
+  ])
+  AM_CONDITIONAL(BUILD_LUA, test "$with_lua" = "yes")
+
+])
diff --git a/m4/pandora_with_perl.m4 b/m4/pandora_with_perl.m4
new file mode 100644 (file)
index 0000000..f17c07a
--- /dev/null
@@ -0,0 +1,81 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+
+AC_DEFUN([PANDORA_WITH_PERL], [
+
+  AC_ARG_WITH([perl], 
+    [AS_HELP_STRING([--with-perl],
+      [Build Perl Bindings @<:@default=yes@:>@])],
+    [with_perl=$withval], 
+    [with_perl=yes])
+
+  AC_ARG_WITH([perl-arch],
+    [AS_HELP_STRING([--with-perl-arch],
+      [Install Perl bindings into system location @<:@default=no@:>@])],
+    [with_perl_arch=$withval],
+    [with_perl_arch=no])
+
+  AS_IF([test "x$with_perl" != "xno"],[
+    AS_IF([test "x$with_perl" != "xyes"],
+      [ac_chk_perl=$with_perl],
+      [ac_chk_perl=perl])
+    AC_CHECK_PROGS(PERL,$ac_chk_perl)
+  ])
+  AS_IF([test "x$PERL" != "x"],[
+    AC_CACHE_CHECK([for Perl include path],[pandora_cv_perl_include],[
+      pandora_cv_perl_include=`$PERL -MConfig -e 'print $Config{archlib};'`
+      pandora_cv_perl_include="${pandora_cv_perl_include}/CORE"
+    ])
+    AC_CACHE_CHECK([for Perl CPPFLAGS],[pandora_cv_perl_cppflags],[
+      pandora_cv_perl_cppflags=`$PERL -MConfig -e 'print $Config{cppflags};'`
+      pandora_cv_perl_cppflags="${pandora_cv_perl_cppflags}"
+    ])
+    PERL_CPPFLAGS="-I${pandora_cv_perl_include} ${pandora_cv_perl_cppflags}"
+
+    AC_CACHE_CHECK([for Perl development headers],
+      [pandora_cv_perl_dev],[
+        
+        save_CPPFLAGS="${CPPFLAGS}"
+        CPPFLAGS="${CPPFLAGS} ${PERL_CPPFLAGS}"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <math.h>
+#include <stdlib.h>
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+        ]])],
+        [pandora_cv_perl_dev=yes],
+        [pandora_cv_perl_dev=no])
+        CPPFLAGS="${save_CPPFLAGS}"
+      ])
+
+    AS_IF([test "${pandora_cv_perl_dev}" = "no"],
+      [with_perl=no])
+
+    AC_CACHE_CHECK([for Perl install location],
+      [pandora_cv_perl_archdir],[
+        AS_IF([test "${with_perl_arch}" = "no"],[
+          pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{sitearch}'`
+        ],[
+          pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{archlib}'`
+        ])
+        pandora_cv_perl_archdir="${pandora_cv_perl_archdir}"
+    ])
+    PERL_ARCHDIR="${pandora_cv_perl_archdir}"
+  ])
+  AC_SUBST([PERL_CPPFLAGS])
+  AC_SUBST([PERL_ARCHDIR])
+
+  AM_CONDITIONAL(BUILD_PERL, [test "$with_perl" != "no"])
+
+])
diff --git a/m4/pandora_with_php.m4 b/m4/pandora_with_php.m4
new file mode 100644 (file)
index 0000000..4e163fd
--- /dev/null
@@ -0,0 +1,56 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+
+AC_DEFUN([PANDORA_WITH_PHP],[
+
+  AC_ARG_WITH([php],
+    [AS_HELP_STRING([--with-php],
+      [Build NDB/PHP @<:@default=no@:>@])],
+    [with_php=$withval],
+    [with_php=no])
+
+  AS_IF([test "x$with_php" != "xno"],[
+    dnl We explicitly requested PHP build. Fail on too-young SWIG.
+    AS_IF([test "x$SWIG_CAN_BUILD_PHP" != "xyes"],
+      [AC_MSG_ERROR("Your version of SWIG is too young to build NDB/PHP. >=1.3.33 is required!")])
+    AS_IF([test "x$with_php" != "xyes"],
+      [ac_check_php_config=$with_php],
+      [ac_check_php_config="php-config php-config5"])
+      AC_CHECK_PROGS(PHP_CONFIG, [$ac_check_php_config])
+    ])
+
+  AS_IF([test "x$PHP_CONFIG" != "x"],[
+    PHP_CFLAGS=`$PHP_CONFIG --includes`
+    PHP_CPPFLAGS=`$PHP_CONFIG --includes`
+    PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
+    PHP_EXTDIR=`$PHP_CONFIG --extension-dir`
+    strip_php_prefix=`$PHP_CONFIG --prefix | sed 's/\//./g'`
+    PHP_ARCH_DIR=`echo $PHP_EXTDIR | sed "s/$strip_php_prefix//"`
+  ],[
+    PHP_CFLAGS=
+    PHP_CPPFLAGS=
+    PHP_LDFLAGS=
+    PHP_EXTDIR=
+    PHP_ARCH_DIR=
+    with_php=no
+  ])
+
+  AC_SUBST(PHP_CFLAGS)
+  AC_SUBST(PHP_CPPFLAGS)
+  AC_SUBST(PHP_LDFLAGS)
+  AC_SUBST(PHP_EXTDIR)
+  AC_SUBST(PHP_ARCH_DIR)
+
+  AM_CONDITIONAL(BUILD_PHP, test "$with_php" = "yes")
+  
+])
+
diff --git a/m4/pandora_with_python.m4 b/m4/pandora_with_python.m4
new file mode 100644 (file)
index 0000000..97aa57f
--- /dev/null
@@ -0,0 +1,28 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+
+AC_DEFUN([PANDORA_WITH_PYTHON], [
+
+  AC_ARG_WITH([python], 
+    [AS_HELP_STRING([--with-python],
+      [Build Python Bindings @<:@default=yes@:>@])],
+    [with_python=$withval], 
+    [with_python=yes])
+
+  AS_IF([test "x$with_python" != "xno"],[
+    AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python])
+    AM_PATH_PYTHON([2.4],,[with_python="no"])
+    AC_PYTHON_DEVEL()
+    AS_IF([test "x$pythonexists" = "xno"],[with_python="no"])
+  ])
+  AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"])
+])
diff --git a/m4/pandora_with_python3.m4 b/m4/pandora_with_python3.m4
new file mode 100644 (file)
index 0000000..9b7117e
--- /dev/null
@@ -0,0 +1,44 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+AC_DEFUN([PANDORA_WITH_PYTHON3], [
+
+  AC_REQUIRE([PANDORA_SWIG])
+
+  AC_ARG_WITH([python3], 
+    [AS_HELP_STRING([--with-python3],
+      [Build Python3 Bindings @<:@default=yes@:>@])],[
+        with_python3=$withval
+        python3_requested=yes
+      ],[ 
+        with_python3=yes
+        python3_requested=no
+      ])
+
+  AS_IF([test "x$ac_cv_swig_has_python3_" != "xyes"],[
+     with_python3=no
+  ],[
+   AS_IF([test "x$with_python3" != "xno"],[
+     AS_IF([test "x$with_python3" != "xyes"],
+       [PYTHON3=$with_python3],[
+        AC_PATH_PROG([PYTHON3],[python3],[no])
+        PANDORA_PYTHON3_DEVEL()
+        AS_IF([test "x$python3exists" = "xno"],[with_python="no"])
+     ]) 
+   ])
+  ])
+  AS_IF([test "x$with_python3" = "xno" -a "$python3_requested" = "yes"],[
+    AC_MSG_ERROR([Python3 support was explicity requested, but Python3 support
+                  was not found. Please correct your build environment and try
+                  again])
+  ])
+  AM_CONDITIONAL(BUILD_PYTHON3, [test "$with_python3" = "yes"])
+])
diff --git a/m4/pandora_with_r.m4 b/m4/pandora_with_r.m4
new file mode 100644 (file)
index 0000000..cc6dc59
--- /dev/null
@@ -0,0 +1,33 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+AC_DEFUN([PANDORA_WITH_R],[
+    dnl Check for GNU R
+    AC_ARG_WITH([r], 
+    [AS_HELP_STRING([--with-r],
+      [Build R Bindings @<:@default=yes@:>@])],
+    [with_r=$withval], 
+    [with_r=yes])
+
+  AS_IF([test "x$with_r" != "xno"],[
+
+    PKG_CHECK_MODULES([R], [libR], [
+      with_r=yes
+    ],[
+      with_r=no
+    ])
+
+   AC_SUBST(R_CFLAGS)
+   AC_SUBST(R_LIBS)
+  ])
+  AM_CONDITIONAL(BUILD_R, test "$with_r" = "yes")
+
+])
diff --git a/m4/pandora_with_ruby.m4 b/m4/pandora_with_ruby.m4
new file mode 100644 (file)
index 0000000..63b4263
--- /dev/null
@@ -0,0 +1,79 @@
+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+dnl   
+dnl pandora-build: A pedantic build system
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl From Monty Taylor
+
+
+AC_DEFUN([PANDORA_WITH_RUBY], [
+
+  AC_ARG_WITH([ruby],
+    [AS_HELP_STRING([--with-ruby],
+      [Build Ruby Bindings @<:@default=yes@:>@])],
+      [with_ruby=$withval],
+      [with_ruby=ruby])
+
+  AS_IF([test "x$with_ruby" != "xno"],[
+    AS_IF([test "x$with_ruby" != "xyes"],
+      [ac_chk_ruby=$with_ruby],
+      [ac_chk_ruby=ruby1.8 ruby])
+    AC_CHECK_PROGS(RUBY,$ac_chk_ruby)
+  ])
+
+  AS_IF([test "x$RUBY" != "x"],[
+
+    AC_MSG_CHECKING(for ruby devel)
+
+    dnl need to change quotes to allow square brackets
+    changequote(<<, >>)dnl
+    ruby_prefix=`$RUBY -rrbconfig -e "print Config::CONFIG['archdir']"`
+    strip_ruby_prefix=`$RUBY -rrbconfig -e "print Config::CONFIG['prefix']" | sed 's/\//./g'`
+    
+    RUBY_LIB=`$RUBY -rrbconfig -e "puts Config::CONFIG['ruby_install_name']"`
+    LIBRUBYARG_SHARED=`$RUBY -rrbconfig -e "puts Config::CONFIG['LIBRUBYARG_SHARED']"`
+    RUBY_DIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['archdir']"`
+    RUBY_ARCH_DIR=`echo $RUBY_DIR | sed "s/$strip_ruby_prefix//"`
+    RUBY_LIBDIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['rubylibdir']"`
+    RUBY_INCLUDES="-I$ruby_prefix"
+    changequote([, ])dnl
+
+    ac_save_CFLAGS="$CFLAGS"
+    ac_save_CPPFLAGS="$CPPFLAGS"
+    ac_save_LDFLAGS="$LDFLAGS"
+    CFLAGS="$ac_save_CFLAGS $RUBY_INCLUDES"
+    CPPFLAGS="$ac_save_CPPFLAGS $RUBY_INCLUDES"
+    LDFLAGS="$ac_save_LDFLAGS $LIBRUBYARG_SHARED"
+    
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ruby.h>]], [[VALUE rb_ac_test = rb_define_module("actest");]])],[with_ruby="yes";AC_MSG_RESULT(found)],[with_ruby="no";AC_MSG_RESULT(missing)])
+
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    CFLAGS="$ac_save_CFLAGS"
+    LDFLAGS="$ac_save_LDFLAGS"
+  ],[
+    # This allows 'make clean' in the ruby directory to work when
+    # ruby isn't available
+    RUBY=
+    RUBY_INCLUDES=
+    LIBRUBYARG_SHARED=
+    RUBY_LIB=
+    RUBY_DIR=
+    RUBY_LIBDIR=
+    RUBY_ARCH_DIR=
+    with_ruby="no"
+  ])
+
+  AC_SUBST(RUBY_INCLUDES)
+  AC_SUBST(LIBRUBYARG_SHARED)
+  AC_SUBST(RUBY_LIB)
+  AC_SUBST(RUBY_DIR)
+  AC_SUBST(RUBY_LIBDIR)
+  AC_SUBST(RUBY_ARCH_DIR)
+
+  AS_IF([test "x$RUBY_DIR" = "x"],[with_ruby="no"])
+  AM_CONDITIONAL(BUILD_RUBY, test "$with_ruby" = "yes")
+])
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644 (file)
index 0000000..0048a3f
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,157 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+               
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+    if test -n "$$1"; then
+        pkg_cv_[]$1="$$1"
+    else
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                        [pkg_failed=yes])
+    fi
+else
+       pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+               [AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+       ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+               [$4])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
index 5cc1f82e4e2cbc4995a259f5bc46c655e4ad3135..c840f68cc9d3124282bbf441af6719c541d624cf 100644 (file)
@@ -27,19 +27,19 @@ libtest_la_SOURCES= test.c
 
 testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
 testapp_SOURCES = function.c
-testapp_LDADD = $(LDADDS) $(top_builddir)/clients/libgenexec.la libtest.la libserver.la
+testapp_LDADD = $(top_builddir)/clients/libgenexec.la libtest.la libserver.la $(LDADDS)
 
 testplus_SOURCES = plus.cpp
-testplus_LDADD = $(LDADDS) libtest.la libserver.la
+testplus_LDADD = libtest.la libserver.la $(LDADDS)
 
 udptest_SOURCES = udp.c
-udptest_LDADD = $(LDADDS) libtest.la libserver.la
+udptest_LDADD = libtest.la libserver.la $(LDADDS)
 
 atomsmasher_SOURCES = atomsmasher.c
-atomsmasher_LDADD = $(LDADDS) $(top_builddir)/clients/libgenexec.la libtest.la libserver.la 
+atomsmasher_LDADD = $(top_builddir)/clients/libgenexec.la libtest.la libserver.la $(LDADDS)
 
 startservers_SOURCES = start.c
-startservers_LDADD = $(LDADDS) libserver.la
+startservers_LDADD = libserver.la $(LDADDS)
 
 record:
        ./testapp > output.res
index dc373e7bb5d012d99484e21a537d53ffa15de733..d3b67f0ff4b320f59b6af25bfce78df785e3cafd 100644 (file)
@@ -2312,6 +2312,7 @@ static test_return  user_supplied_bug16(memcached_st *memc)
   return 0;
 }
 
+#ifndef __sun
 /* Check the validity of chinese key*/
 static test_return  user_supplied_bug17(memcached_st *memc)
 {
@@ -2338,6 +2339,7 @@ static test_return  user_supplied_bug17(memcached_st *memc)
 
     return 0;
 }
+#endif
 
 /*
   From Andrei on IRC
@@ -3342,7 +3344,7 @@ static memcached_return  poll_timeout(memcached_st *memc)
 
   memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout);
 
-  timeout= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
+  timeout= (size_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
 
   assert(timeout == 100);