+*.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
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
+ 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.
-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
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
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);
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;
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},
};
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},
};
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}
};
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},
};
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;
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;
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},
};
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},
};
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;
}
{
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.");
# 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
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
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
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`"
# 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])
PANDORA_CANONICAL_TARGET
#shared library versioning
-MEMCACHED_LIBRARY_VERSION=2:0:0
+MEMCACHED_LIBRARY_VERSION=3:0:0
# | | |
# +------+ | +---+
# | | |
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;
}
#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;
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;
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;
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;
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:
}
#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);
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;
}
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;
}
}
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;
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;
}
}
while (key_length--)
{
- value += (uint32_t) *ptr++;
+ uint32_t val= (uint32_t) *ptr++;
+ value += val;
value += (value << 10);
value ^= (value >> 6);
}
*/
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
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;
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"],
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}"
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
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], [
[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])
])
])
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 ])
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
])
])
- 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
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}"
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 {
};
_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
])])
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
])
+ ])
])
])
])
--- /dev/null
+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])
+])
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],
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],[
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}]))
])
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],[
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}]))
])
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],[
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"])
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}]))
])
--- /dev/null
+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}]))
+])
--- /dev/null
+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.])
+ ])
+])
+
+
+++ /dev/null
-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])
-])
--- /dev/null
+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])
+ ])
+
+])
--- /dev/null
+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} $*"
+])
--- /dev/null
+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)])
+])
--- /dev/null
+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!
+ #
+])
+
--- /dev/null
+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])
+ ])
+ ])
+])
--- /dev/null
+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}"
+ ])
+ ])
+])
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])
+
+])
+
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"
])
])
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"
])
AC_SUBST(NO_SHADOW)
AC_SUBST(NO_STRICT_ALIASING)
AC_SUBST(PROTOSKIP_WARNINGS)
+ AC_SUBST(INNOBASE_SKIP_WARNINGS)
+ AC_SUBST(NO_WERROR)
])
--- /dev/null
+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")
+
+])
--- /dev/null
+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"])
+
+])
--- /dev/null
+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")
+
+])
+
--- /dev/null
+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"])
+])
--- /dev/null
+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"])
+])
--- /dev/null
+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")
+
+])
--- /dev/null
+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")
+])
--- /dev/null
+# 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
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
return 0;
}
+#ifndef __sun
/* Check the validity of chinese key*/
static test_return user_supplied_bug17(memcached_st *memc)
{
return 0;
}
+#endif
/*
From Andrei on IRC
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);