+1.0.18
+
1.0.17 Tue Apr 2 14:02:01 HST 2013
* Remove c++ namespace that was being exposed (the API should be plug compatible)..
* Fix cases where --servers wasn't behaving the same in all clients.
# vim:ft=automake
-ACLOCAL_AMFLAGS = -I m4 -I libtest/m4
+ACLOCAL_AMFLAGS= -I m4 -I libtest/m4
+AM_YFLAGS= -d
# includes append to these:
SUFFIXES =
-rm -f build-aux/install-sh
-rm -f build-aux/ltmain.sh
-rm -f build-aux/missing
+ -rm -f build-aux/ylwrap
-rm -f mem_config.in
-rm -f config.log
-rm -f config.status
function set_VENDOR_RELEASE ()
{
local release=`echo "$1" | tr '[A-Z]' '[a-z]'`
- case "$VENDOR_DISTRIBUTION" in
+
+ if $DEBUG; then
+ echo "VENDOR_DISTRIBUTION:$VENDOR_DISTRIBUTION"
+ echo "VENDOR_RELEASE:$release"
+ fi
+
+ case $VENDOR_DISTRIBUTION in
darwin)
- case "$VENDOR_DISTRIBUTION" in
+ case $release in
10.6*)
VENDOR_RELEASE='snow_leopard'
;;
mountain)
VENDOR_RELEASE='mountain'
;;
- 10.8*)
+ 10.8.*)
+ echo "mountain_lion"
VENDOR_RELEASE='mountain_lion'
;;
*)
+ echo $VENDOR_RELEASE
VENDOR_RELEASE='unknown'
;;
esac
VENDOR_RELEASE="precise"
elif [[ "x$VENDOR_RELEASE" == 'x12.10' ]]; then
VENDOR_RELEASE="quantal"
+ elif [[ "x$VENDOR_RELEASE" == 'x13.04' ]]; then
+ VENDOR_RELEASE="raring"
fi
;;
opensuse)
local BUILD_CONFIGURE_ARG=
# If ENV DEBUG is set we enable both debug and asssert, otherwise we see if this is a VCS checkout and if so enable assert
- # Set ENV ASSERT in order to enable assert
- if $DEBUG; then
- BUILD_CONFIGURE_ARG+=' --enable-debug --enable-assert'
- elif [[ -n "$VCS_CHECKOUT" ]]; then
- BUILD_CONFIGURE_ARG+=' --enable-assert'
+ # Set ENV ASSERT in order to enable assert.
+ # If we are doing a valgrind run, we always compile with assert disabled
+ if $valgrind_run; then
+ BUILD_CONFIGURE_ARG+= " CXXFLAGS=-DNDEBUG "
+ BUILD_CONFIGURE_ARG+= " CFLAGS=-DNDEBUG "
+ else
+ if $DEBUG; then
+ BUILD_CONFIGURE_ARG+=' --enable-debug --enable-assert'
+ elif [[ -n "$VCS_CHECKOUT" ]]; then
+ BUILD_CONFIGURE_ARG+=' --enable-assert'
+ fi
fi
if [[ -n "$CONFIGURE_ARG" ]]; then
function setup_valgrind_command () {
VALGRIND_PROGRAM=`type -p valgrind`
if [[ -n "$VALGRIND_PROGRAM" ]]; then
- VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE"
+ VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --malloc-fill=A5 --free-fill=DE --xml=yes --xml-file=\"valgrind-%p.xml\""
fi
}
function make_valgrind ()
{
- if [[ "$VENDOR_DISTRIBUTION" == 'darwin' ]]; then
- make_darwin_malloc
- return
- fi
-
# If the env VALGRIND_COMMAND is set then we assume it is valid
local valgrind_was_set=false
if [[ -z "$VALGRIND_COMMAND" ]]; then
save_BUILD
+ valgrind_run=true
+
# If we are required to run configure, do so now
- run_configure_if_required
+ run_configure
# If we don't have a configure, then most likely we will be missing libtool
assert_file 'configure'
TESTS_ENVIRONMENT="$VALGRIND_COMMAND"
fi
- make_target 'check' || return 1
+ make_target 'all'
+ make_target 'check'
+ ret=$?
+
+ # If we aren't going to error, we will clean up our environment
+ if [ "$ret" -eq 0 ]; then
+ make 'distclean'
+ fi
+
+ valgrind_run=false
restore_BUILD
+
+ if [ "$ret" -ne 0 ]; then
+ return 1
+ fi
}
function make_install_system ()
MallocScribble=$old_MallocScribble
}
-function snapshot_check ()
-{
- if [ ! -f "$BOOTSTRAP_SNAPSHOT_CHECK" ]; then
- make_for_snapshot
- fi
-
- if [ -n "$BOOTSTRAP_SNAPSHOT_CHECK" ]; then
- assert_file "$BOOTSTRAP_SNAPSHOT_CHECK" 'snapshot check failed'
- fi
-}
-
# This will reset our environment, and make sure built files are available.
function make_for_snapshot ()
{
- # Make sure it is clean
- make_maintainer_clean
+ # Lets make sure we have a clean environment
+ assert_no_file 'Makefile'
+ assert_no_file 'configure'
+ assert_no_directory 'autom4te.cache'
run_configure
- make_target 'dist'
+ make_target 'all'
make_target 'distclean'
# We should have a configure, but no Makefile at the end of this exercise
assert_no_file 'Makefile'
assert_exec_file 'configure'
-
- snapshot_check
}
function check_mingw ()
function check_for_jenkins ()
{
if ! $jenkins_build_environment; then
- echo "Not inside of jenkins"
+ echo "Not inside of jenkins, simulating environment"
if [ -f 'configure' ]; then
make_maintainer_clean
make_install_system
}
+function check_snapshot ()
+{
+ if [ -n "$BOOTSTRAP_SNAPSHOT_CHECK" ]; then
+ assert_file "$BOOTSTRAP_SNAPSHOT_CHECK" 'snapshot check failed'
+ fi
+}
+
function make_for_continuus_integration ()
{
# Setup the environment if we are local
# Platforms which require bootstrap should have some setup done before we hit this stage.
# If we are building locally, skip this step, unless we are just testing locally.
if $BOOTSTRAP_SNAPSHOT; then
- snapshot_check
+ if $BOOTSTRAP_SNAPSHOT; then
+ assert_file 'configure'
+ fi
+
+ check_snapshot
else
# If we didn't require a snapshot, then we should not have a configure
assert_no_file 'configure'
make_rpm
elif [[ -d rpm ]]; then
make_rpm
- else
- make_distcheck
fi
-
- assert_exec_file 'configure'
- assert_file 'Makefile'
-
- make_install_system
- ;;
- *-precise-*)
- run_configure
-
- assert_exec_file 'configure'
- assert_file 'Makefile'
-
- make_target 'all'
-
- make_distcheck
-
- assert_exec_file 'configure'
- assert_file 'Makefile'
-
- make_valgrind
-
- assert_exec_file 'configure'
- assert_file 'Makefile'
-
- make_install_system
;;
*)
make_jenkins_default
run $BOOTSTRAP_LIBTOOLIZE '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE"
fi
- run $AUTORECONF || die "Cannot execute $AUTORECONF"
+ run $AUTORECONF $AUTORECONF_ARGS || die "Cannot execute $AUTORECONF"
eval 'bash -n configure' || die "autoreconf generated a malformed configure"
}
fi
fi
fi
+
if $VERBOSE; then
LIBTOOLIZE_OPTIONS="--verbose $BOOTSTRAP_LIBTOOLIZE_OPTIONS"
fi
+
if $DEBUG; then
LIBTOOLIZE_OPTIONS="--debug $BOOTSTRAP_LIBTOOLIZE_OPTIONS"
fi
+
+ # Here we set LIBTOOLIZE to true since we are going to invoke it via BOOTSTRAP_LIBTOOLIZE
LIBTOOLIZE=true
fi
fi
if [[ -n "$GNU_BUILD_FLAGS" ]]; then
- AUTORECONF="$AUTORECONF $GNU_BUILD_FLAGS"
+ AUTORECONF_ARGS="$GNU_BUILD_FLAGS"
fi
fi
fi
local snapshot_run=false
+ local valgrind_run=false
case $target in
'self')
'snapshot')
make_for_snapshot
snapshot_run=true
+ check_snapshot
;;
'rpm')
make_rpm
;;
+ 'darwin_malloc')
+ make_darwin_malloc
+ ;;
'valgrind')
+ make_maintainer_clean
make_valgrind
;;
'universe')
# Use and distribution licensed under the BSD license. See
# the COPYING file in this directory for full text.
-AC_INIT([libmemcached],[1.0.17],[http://libmemcached.org/])
+m4_include([version.m4])
+AC_INIT([libmemcached],VERSION_NUMBER,[http://libmemcached.org/])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
LT_LANG([C++])
LT_LIB_M
+AC_PROG_CC_C99
+AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
+
AX_ASSERT
AX_PLATFORM
ENABLE_DEPRECATED
# Checks for programs.
+AC_CHECK_PROGS([DPKG_GENSYMBOLS],[dpkg-gensymbols])
+AC_CHECK_PROGS([LEX],['flex'],[:])
+AC_CHECK_PROGS([PERL],[perl])
+AC_CHECK_PROGS([VALGRIND],['valgrind'])
+AC_CHECK_PROGS([WINE],['wine'])
+AC_CHECK_PROGS([YACC],['bison --warnings=all'],[:])
AC_PROG_AWK
-AC_PROG_SED
AC_PROG_MKDIR_P
-AC_CHECK_PROGS([LEX],['flex'],[:])
-AC_CHECK_PROGS([YACC],['bison'],[:])
-AX_PROG_SPHINX_BUILD
+AC_PROG_SED
AX_PROG_MEMCACHED
+AX_PROG_SPHINX_BUILD(,[AC_MSG_WARN([sphinx-build version 1.0 or greater is required to build man pages])])
+AX_WITH_PROG([LCOV],[lcov])
+AX_WITH_PROG([LCOV_GENHTML],[genhtml])
+AC_DEFINE([HAVE_MEMCACHED_SASL_BINARY],[0],[If Memcached binary with sasl support is available])
# Checks for libraries.
AC_SEARCH_LIBS([getopt_long],[gnugetopt])
-rm -rf docs/_build docs/doctrees man/.doctrees/
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-if HAVE_SPHINX
sphinx-help:
@echo "Please use \`make <target>' where <target> is one of"
text: docs/conf.py
@PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/text
-if HAVE_RECENT_SPHINX
man:
@PYTHONPATH=$(SPHINX_BUILDDIR)/docs $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) ${top_builddir}/man
-else
-
-man:
-
-endif
changes: docs/conf.py
@PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/changes
PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(SPHINX_BUILDDIR)/doctest/output.txt."
-
-else
-
-man:
-
-endif
aes_key_t* aes_create_key(const char *key, const size_t key_length)
{
- aes_key_t* _aes_key= (aes_key_t*)calloc(1, sizeof(aes_key_t));
+ aes_key_t* _aes_key= (aes_key_t*)(calloc(1, sizeof(aes_key_t)));
if (_aes_key)
{
uint8_t rkey[AES_KEY_LENGTH/8];
{
ptr= rkey; /* Just loop over tmp_key until we used all key */
}
- *ptr^= (uint8_t) *sptr;
+ *ptr^= (uint8_t)(*sptr);
}
_aes_key->decode_key.nr= rijndaelKeySetupDec(_aes_key->decode_key.rk, rkey, AES_KEY_LENGTH);
return NULL;
}
- aes_key_t* _aes_clone_key= (aes_key_t*)calloc(1, sizeof(aes_key_t));
+ aes_key_t* _aes_clone_key= (aes_key_t*)(calloc(1, sizeof(aes_key_t)));
if (_aes_clone_key)
{
memcpy(_aes_clone_key, _aes_key, sizeof(aes_key_t));
for (size_t x= num_blocks; x > 0; x--) /* Encode complete blocks */
{
- rijndaelEncrypt(_aes_key->encode_key.rk, _aes_key->encode_key.nr, (const uint8_t*) source,
- (uint8_t*) dest);
+ rijndaelEncrypt(_aes_key->encode_key.rk, _aes_key->encode_key.nr, (const uint8_t*)(source),
+ (uint8_t*) (dest));
source+= AES_BLOCK_SIZE;
dest+= AES_BLOCK_SIZE;
}
char pad_len= AES_BLOCK_SIZE - (source_length - AES_BLOCK_SIZE*num_blocks);
memcpy(block, source, 16 -pad_len);
memset(block + AES_BLOCK_SIZE -pad_len, pad_len, pad_len);
- rijndaelEncrypt(_aes_key->encode_key.rk, _aes_key->encode_key.nr, block, (uint8_t*) dest);
+ rijndaelEncrypt(_aes_key->encode_key.rk, _aes_key->encode_key.nr, block, (uint8_t*) (dest));
hashkit_string_set_length(destination, AES_BLOCK_SIZE*(num_blocks + 1));
}
for (size_t x = num_blocks-1; x > 0; x--)
{
- rijndaelDecrypt(_aes_key->decode_key.rk, _aes_key->decode_key.nr, (const uint8_t*) source, (uint8_t*) dest);
+ rijndaelDecrypt(_aes_key->decode_key.rk, _aes_key->decode_key.nr, (const uint8_t*) (source), (uint8_t*)(dest));
source+= AES_BLOCK_SIZE;
dest+= AES_BLOCK_SIZE;
}
uint8_t block[AES_BLOCK_SIZE];
- rijndaelDecrypt(_aes_key->decode_key.rk, _aes_key->decode_key.nr, (const uint8_t*) source, block);
+ rijndaelDecrypt(_aes_key->decode_key.rk, _aes_key->decode_key.nr, (const uint8_t*)(source), block);
/* Use last char in the block as size */
- unsigned int pad_len= (unsigned int) (unsigned char) block[AES_BLOCK_SIZE-1];
+ unsigned int pad_len= (unsigned int) (unsigned char)(block[AES_BLOCK_SIZE-1]);
if (pad_len > AES_BLOCK_SIZE)
{
hashkit_string_free(destination);
SGCHECK_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-sgcheck --error-exitcode=1
VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
-DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd --error-exitcode=1
+DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd --free-is-write=yes --error-exitcode=1
SGCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-sgcheck --error-exitcode=1
MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif
GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
check_PROGRAMS+= libtest/skiptest
noinst_PROGRAMS+= libtest/skiptest
+test-skiptest: libtest/skiptest
+ @libtest/skiptest
+
+valgrind-skiptest: libtest/skiptest
+ @$(VALGRIND_COMMAND) libtest/skiptest
+
+helgrind-skiptest: libtest/skiptest
+ @$(HELGRIND_COMMAND) libtest/skiptest
+
+drd-skiptest: libtest/skiptest
+ @$(DRD_COMMAND) libtest/skiptest
+
libtest_wait_SOURCES=
libtest_wait_SOURCES+= libtest/wait.cc
libtest_wait_SOURCES+= libtest/dream.cc
std::auto_ptr<libtest::Framework> frame(new libtest::Framework(signal, binary_name, collection_to_run, wildcard));
// Run create(), bail on error.
- try
{
switch (frame->create())
{
break;
case TEST_SKIPPED:
- return EXIT_SKIP;
+ SKIP("SKIP was returned from framework create()");
+ break;
case TEST_FAILURE:
std::cerr << "Could not call frame->create()" << std::endl;
return EXIT_FAILURE;
}
}
- catch (const libtest::__skipped& e)
- {
- return EXIT_SKIP;
- }
frame->exec();
AC_CONFIG_FILES([libtest/version.h])
m4_include([libtest/m4/mysql.m4])
-AC_DEFINE([HAVE_MEMCACHED_SASL_BINARY],[0],[If Memcached binary with sasl support is available])
YATL_MYSQL
#
# LICENSE
#
-# Copyright (C) 2012 Brian Aker
+# Copyright (C) 2012-2013 Brian Aker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Notes:
+# We do not test for c99 or c++11, that is out of scope.
# The Following flags are not checked for
# -Wdeclaration-after-statement is counter to C99
-# _APPEND_COMPILE_FLAGS_ERROR([-std=c++11]) -- Not ready yet
-# _APPEND_COMPILE_FLAGS_ERROR([-pedantic]) --
-# ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for
-# compatibility issues memcached_stat_st
+# _APPEND_COMPILE_FLAGS_ERROR([-pedantic])
-#serial 9
+#serial 10
AC_DEFUN([_WARNINGS_AS_ERRORS],
[AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],
# Everything above this does the heavy lifting, while what follows does the specifics.
AC_DEFUN([_HARDEN_LINKER_FLAGS],
- [
- AS_IF([test "$CC" != "clang"],
- [_APPEND_LINK_FLAGS_ERROR([-z relro -z now])
-#_APPEND_LINK_FLAGS_ERROR([-pie])
- AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],
- [AX_APPEND_LINK_FLAGS([-Werror])])])
- ])
+ [AS_IF([test "$CC" != "clang"],
+ [_APPEND_LINK_FLAGS_ERROR([-z relro -z now])
+ AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],[AX_APPEND_LINK_FLAGS([-Werror])])
+ AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[_APPEND_LINK_FLAGS_ERROR([-rdynamic])])
+ ])
+ ])
AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
[AC_LANG_PUSH([C])dnl
[_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
_APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])
- AS_IF([test "$CC" = "clang"],
- [_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
+ AS_IF([test "$CC" = "clang"],[_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
_APPEND_COMPILE_FLAGS_ERROR([-Wall])
_APPEND_COMPILE_FLAGS_ERROR([-Wextra])
+ _APPEND_COMPILE_FLAGS_ERROR([-Weverything])
_APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
- _APPEND_COMPILE_FLAGS_ERROR([-std=c99])
# Anything below this comment please keep sorted.
# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
_APPEND_COMPILE_FLAGS_ERROR([-Wunsuffixed-float-constants])
_APPEND_COMPILE_FLAGS_ERROR([-Wno-suggest-attribute=pure])
_APPEND_COMPILE_FLAGS_ERROR([-Wno-redundant-decls])],
[_APPEND_COMPILE_FLAGS_ERROR([-Wredundant-decls])])
-
_APPEND_COMPILE_FLAGS_ERROR([-Wshadow])
_APPEND_COMPILE_FLAGS_ERROR([-Wshorten-64-to-32])
_APPEND_COMPILE_FLAGS_ERROR([-Wsign-compare])
_APPEND_COMPILE_FLAGS_ERROR([-Wundef])
_APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])
_APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
- AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
- _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
- AS_IF([test "x$enable_shared" = "xyes"],[
+ AS_IF([test "x$MINGW" != xyes],[
+ AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
+ AS_IF([test "x$enable_shared" = "xyes"],[
+ _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
_APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
- ])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+ ])
+ ])
])
_APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
_APPEND_COMPILE_FLAGS_ERROR([-Wunused])
_APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
_APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
_APPEND_COMPILE_FLAGS_ERROR([-pipe])
+ _APPEND_COMPILE_FLAGS_ERROR([-fPIE -pie])
_APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
+ _APPEND_COMPILE_FLAGS_ERROR([-Wpacked])
+# _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long])
+ _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
AS_IF([test "x$ax_enable_debug" = xno],
[AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
[AS_IF([test "x$ac_c_gcc_recent" = xyes],
[_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2])
#_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector])
- #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector])
- #_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])
+ #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector --param=ssp-buffer-size=4])
_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])
])])])])
[_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
_APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])
- AS_IF([test "$CXX" = "clang++"],
- [_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
+ AS_IF([test "$CXX" = "clang++"],[_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
_APPEND_COMPILE_FLAGS_ERROR([-Wall])
_APPEND_COMPILE_FLAGS_ERROR([-Wextra])
+ _APPEND_COMPILE_FLAGS_ERROR([-Weverything])
_APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
# Anything below this comment please keep sorted.
# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
_APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
_APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])
# _APPEND_COMPILE_FLAGS_ERROR([-Weffc++])
- AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
- _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
- AS_IF([test "x$enable_shared" = "xyes"],[
+ AS_IF([test "x$MINGW" != xyes],[
+ AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
+ AS_IF([test "x$enable_shared" = "xyes"],[
+ _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
_APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
- ])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+ ])
+ ])
])
# _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])
_APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
_APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
_APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
_APPEND_COMPILE_FLAGS_ERROR([-pipe])
+ _APPEND_COMPILE_FLAGS_ERROR([-fPIE -pie])
_APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
+ _APPEND_COMPILE_FLAGS_ERROR([-Wpacked])
+# _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long])
+ _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
AS_IF([test "x$ax_enable_debug" = xno],
[AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
[AS_IF([test "x$ac_c_gcc_recent" = xyes],
[_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2])
#_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector])
- #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector])
- #_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])
+ #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector --param=ssp-buffer-size=4])
_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])
])])])])
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#serial 3
+#serial 4
AC_DEFUN([AX_PROG_MEMCACHED],
- [AX_WITH_PROG([MEMCACHED_BINARY],[memcached])
- AS_IF([test -f "$ac_cv_path_MEMCACHED_BINARY"],
- [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
- AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$ac_cv_path_MEMCACHED_BINARY",[Name of the memcached binary used in make test])
- ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
- AC_MSG_RESULT([memcached version "$ax_memcached_version"])
- AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])
- ])
- ])
+ [AX_WITH_PROG([MEMCACHED_BINARY],[memcached],[unknown])
+ ax_memcached_success=
+ AS_IF([test x"$MEMCACHED_BINARY" != xunknown],
+ [AS_IF([test -x "$MEMCACHED_BINARY"],
+ [ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
+ AS_IF([test -n "$ax_memcached_version"],
+ [ax_memcached_success='ok'
+ AC_MSG_RESULT([memcached version "$ax_memcached_version"])
+ AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])])
+ ])
+ ])
+
+ AS_IF([test -n "$ax_memcached_success"],
+ [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
+ AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$MEMCACHED_BINARY",[Name of the memcached binary used in make test])
+ ],
+ [AC_DEFINE([HAVE_MEMCACHED_BINARY], [0], [If Memcached binary is available])
+ MEMCACHED_BINARY=
+ ])
+ ])
#
# SYNOPSIS
#
-# AX_PROG_SPHINX_BUILD()
+# AX_PROG_SPHINX_BUILD([ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
#
# DESCRIPTION
#
-# Look for sphinx-build
+# Look for sphinx-build and make sure it is a recent version of it.
#
# LICENSE
#
-# Copyright (c) 2012 Brian Aker <brian@tangent.org>
+# Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 2
+#serial 3
AC_DEFUN([AX_PROG_SPHINX_BUILD],
- [AC_PREREQ([2.63])dnl
- AC_CHECK_PROGS([PERL], [perl])
- AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
- AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found])
- AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found])
-
- AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
- AS_IF([test "x${SPHINXBUILD}" != "x:"],[
- AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
-
- ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
- AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
- [ac_cv_recent_sphinx=no])
+ [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
+ AS_IF([test x"SPHINXBUILD" = x":"],
+ [SPHINXBUILD=],
+ [AS_IF([test -x "$SPHINXBUILD"],
+ [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
+ junk=`$SPHINXBUILD &> version_file`
+ ax_sphinx_build_version=`head -1 version_file`
+ rm version_file
+ AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
+ $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
+ AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
rm -rf conftest.d
])
])
- AM_CONDITIONAL([HAVE_DPKG_GENSYMBOLS],[test "x${DPKG_GENSYMBOLS}" != "x:"])
- AM_CONDITIONAL([HAVE_SPHINX],[test "x${SPHINXBUILD}" != "x:"])
- AM_CONDITIONAL([HAVE_RECENT_SPHINX],[test "x${ac_cv_recent_sphinx}" = "xyes"])
-])
+ AS_IF([test -n "${SPHINXBUILD}"],
+ [AC_SUBST([SPHINXBUILD])
+ ifelse([$1], , :, [$1])],
+ [ifelse([$2], , :, [$2])])
+ ])
# SYNOPSIS
#
# AX_UUID()
+# AX_UUID_GENERATE_TIME()
# AX_UUID_GENERATE_TIME_SAFE()
#
# DESCRIPTION
#
-# Check for uuid, and uuid_generate_time_safe support.
+# Check for uuid, uuid_generate_time, and uuid_generate_time_safe support.
#
# LICENSE
#
-# Copyright (c) 2012 Brian Aker <brian@tangent.org>
+# Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 6
+#serial 7
AC_DEFUN([AX_UUID],
[AC_PREREQ([2.63])dnl
AM_CONDITIONAL([HAVE_LIBUUID],[test "x$ax_libuuid" = xyes])
])
+ AC_DEFUN([AX_UUID_GENERATE_TIME],
+ [AC_PREREQ([2.63])dnl
+ AC_REQUIRE([AX_UUID])dnl
+ AC_CACHE_CHECK([for uuid_generate_time],
+ [ax_cv_uuid_generate_time],
+ [AX_SAVE_FLAGS
+ LIBS="$LIBUUID_LIB $LIBS"
+ AC_LANG_PUSH([C])
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([#include <uuid/uuid.h>],[
+ uuid_t out;
+ uuid_generate_time(out);
+ ])],
+ [ax_cv_uuid_generate_time=yes],
+ [ax_cv_uuid_generate_time=no],
+ [AC_MSG_WARN([test program execution failed])])
+ AC_LANG_POP
+ AX_RESTORE_FLAGS
+ ])
+
+ AS_IF([test "$ax_cv_uuid_generate_time" = yes],
+ [AC_DEFINE([HAVE_UUID_GENERATE_TIME],[1],[Define if uuid_generate_time is present in uuid/uuid.h.])],
+ [AC_DEFINE([HAVE_UUID_GENERATE_TIME],[0],[Define if uuid_generate_time is present in uuid/uuid.h.])])
+ ])
+
AC_DEFUN([AX_UUID_GENERATE_TIME_SAFE],
[AC_PREREQ([2.63])dnl
AC_REQUIRE([AX_UUID])dnl
# included from Top Level Makefile.am
# All paths should be given relative to the root
-if HAVE_RECENT_SPHINX
-if IS_VCS_CHECKOUT
-
-dist-hook: man
-
# Build rule for documentation
-$(dist_man_MANS): man
-
-BUILT_SOURCES+= $(dist_man_MANS)
+$(dist_man_MANS): $(top_srcdir)/configure.ac
+ $(MAKE) $(AM_MAKEFLAGS) man
-endif
-endif
+.NOTPARALLEL: $(dist_man_MANS)
dist_man_MANS+= man/memaslap.1
dist_man_MANS+= man/memcapable.1
pahole-mem: tests/testapp
@$(PAHOLE_COMMAND) tests/testapp
+pahole-hash: tests/testhashkit
+ @$(PAHOLE_COMMAND) tests/testhashkit
+
gdb-mem: tests/libmemcached-1.0/testapp
@$(GDB_COMMAND) tests/libmemcached-1.0/testapp
helgrind-hashplus: tests/hash_plus
@$(HELGRIND_COMMAND) tests/hash_plus
+
+drd-mem: tests/libmemcached-1.0/testapp
+ @$(DRD_COMMAND) tests/libmemcached-1.0/testapp
+
+drd-cycle: tests/cycle
+ @$(DRD_COMMAND) tests/cycle
--- /dev/null
+m4_define([VERSION_NUMBER], [1.0.18])