tests/var/
tmp_chroot
unittests/unittests
+aminclude.am
# vim:ft=automake
-ACLOCAL_AMFLAGS = -I m4 -I libtest/m4
+ACLOCAL_AMFLAGS = -I m4 -I libtest/m4 --install -Wall -Werror
# includes append to these:
SUFFIXES =
BUILT_SOURCES=
EXTRA_DIST=
+#includes additional rules from aminclude.am
+@INC_AMINCLUDE@
+
EXTRA_DIST+= ${srcdir}/m4/pandora_*.m4
EXTRA_DIST+= .quickly
EXTRA_DIST+= README.FIRST
setup_gdb_command () {
GDB_TMPFILE=$(mktemp /tmp/gdb.XXXXXXXXXX)
- echo "set logging on" > $GDB_TMPFILE
- echo "set logging overwrite on" >> $GDB_TMPFILE
+ echo "set logging overwrite on" > $GDB_TMPFILE
+ echo "set logging on" >> $GDB_TMPFILE
echo "set environment LIBTEST_IN_GDB=1" >> $GDB_TMPFILE
echo "run" >> $GDB_TMPFILE
echo "thread apply all bt" >> $GDB_TMPFILE
fi
MAKE_TARGET=$1
- run $MAKE $MAKE_J $MAKE_TARGET || die "Cannot execute $MAKE $MAKE_TARGET"
+ run $MAKE $MAKE_TARGET || die "Cannot execute $MAKE $MAKE_TARGET"
if [ -n "$MAKE_TARGET" ]; then
MAKE_TARGET=$OLD_MAKE_TARGET
make_target distclean
}
+make_maintainer_clean () {
+ make_target maintainer-clean
+}
+
make_check () {
make_target check
}
MAKE="make"
fi
- # Set ENV MAKE_J in order to override "-j2"
- if [ -z "$MAKE_J" ]; then
- MAKE_J="-j2"
- fi
-
# Set ENV PREFIX in order to set --prefix for ./configure
if [ -n "$PREFIX" ]; then
PREFIX_ARG="--prefix=$PREFIX"
fi
if [ -f Makefile ]; then
- $MAKE $MAKE_J maintainer-clean
+ make_maintainer_clean
+ rm -f Makefile.in
+ rm -f aminclude.am
fi
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Cannot execute $LIBTOOLIZE $LIBTOOLIZE_FLAGS"
AX_CXX_GCC_ABI_DEMANGLE
AX_SASL_CHECK
+AX_LIBEVENT
dnl
dnl The sasl functions should only be visible if we build with sasl support
])
SOCKET_SEND_FLAGS
-AX_CHECK_LIBRARY([LIBEVENT], [event.h], [event],
- [LIBEVENT_LDFLAGS="-levent"],
- [AC_MSG_WARN([Unable to find libevent])])
-AM_CONDITIONAL(HAVE_LIBEVENT, test "x${ax_cv_have_LIBEVENT}" = "xyes")
-
AX_UUID_GENERATE_TIME_SAFE
AX_CXX_COMPILER_VERSION
AX_HARDEN_COMPILER_FLAGS
+AX_AM_JOBSERVER([yes])
+
AC_CONFIG_FILES([
Makefile
docs/conf.py
echo " * C++ Compiler: $CXX_VERSION"
echo " * C++ Flags: $CXXFLAGS"
echo " * CPP Flags: $CPPFLAGS"
-echo " * Assertions enabled: $ac_cv_assert"
-echo " * Debug enabled: $with_debug"
+echo " * Assertions enabled: $ax_enable_assert"
+echo " * Debug enabled: $ax_enable_debug"
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
echo " * SASL support: $ac_enable_sasl"
echo ""
example_memcached_light_SOURCES=
example_memcached_light_LDADD=
+example_memcached_light_LDFLAGS=
example_memcached_light_SOURCES+= example/byteorder.cc
example_memcached_light_SOURCES+= example/interface_v0.cc
example_memcached_light_SOURCES+= util/pidfile.cc
example_memcached_light_LDADD+= libmemcached/libmemcachedprotocol.la
-example_memcached_light_LDADD+= $(LIBEVENT_LDFLAGS)
+example_memcached_light_LDFLAGS+= @LIBEVENT_LDFLAGS@
include example/t/include.am
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_AM_MACRO([RULE])
+#
+# DESCRIPTION
+#
+# Adds the specified rule to $AMINCLUDE. This macro will only work
+# properly with implementations of Make which allow include statements.
+# See also AX_ADD_AM_MACRO_STATIC.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# 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 9
+
+AC_DEFUN([AX_ADD_AM_MACRO],[
+ AC_REQUIRE([AX_AM_MACROS])
+ AX_APPEND_TO_FILE([$AMINCLUDE],[$1])
+])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_am_jobserver.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AM_JOBSERVER([default_value])
+#
+# DESCRIPTION
+#
+# Enables the use of make's jobserver for the purpose of parallel building
+# by passing the -j option to make.
+#
+# The option --enable-jobserver is added to configure which can accept a
+# yes, no, or an integer. The integer is the number of separate jobs to
+# allow. If 'yes' is given, then the is assumed to be one more than the
+# number of CPUs (determined through AX_COUNT_CPUS). If the value of no is
+# given, then the jobserver is disabled. The default value is given by the
+# first argument of the macro, or 'yes' if the argument is omitted.
+#
+# This macro makes use of AX_AM_MACROS, so you must add the following line
+#
+# @INC_AMINCLUDE@
+#
+# to your Makefile.am files.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
+#
+# 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 7
+
+AC_DEFUN([AX_AM_JOBSERVER], [
+ AC_REQUIRE([AX_COUNT_CPUS])
+ AC_REQUIRE([AX_AM_MACROS])
+ AC_ARG_ENABLE( jobserver,
+ [ --enable-jobserver@<:@=no/yes/@%:@@:>@ default=m4_ifval([$1],[$1],[yes])
+ Enable up to @%:@ make jobs
+ yes: enable one more than CPU count
+ ],, [enable_jobserver=m4_ifval([$1],[$1],[yes])])
+ if test "x$enable_jobserver" = "xyes"; then
+ enable_jobserver=$CPU_COUNT
+ ((enable_jobserver++))
+ fi
+ m4_pattern_allow(AM_MAKEFLAGS)
+ if test "x$enable_jobserver" != "xno"; then
+ AC_MSG_NOTICE([added jobserver support to make for $enable_jobserver jobs])
+ AX_ADD_AM_MACRO( AM_MAKEFLAGS += -j$enable_jobserver )
+ fi
+])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_am_macros.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AM_MACROS
+#
+# DESCRIPTION
+#
+# Adds support for macros that create Make rules. You must manually add
+# the following line
+#
+# @INC_AMINCLUDE@
+#
+# to your Makefile.in (or Makefile.am if you use Automake) files.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# 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 9
+
+AC_DEFUN([AX_AM_MACROS],
+[
+AC_MSG_NOTICE([adding automake macro support])
+AMINCLUDE="aminclude.am"
+AC_SUBST(AMINCLUDE)
+AC_MSG_NOTICE([creating $AMINCLUDE])
+AMINCLUDE_TIME=`date`
+AX_PRINT_TO_FILE([$AMINCLUDE],[[
+# generated automatically by configure from AX_AUTOMAKE_MACROS
+# on $AMINCLUDE_TIME
+
+]])
+
+INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE"
+AC_SUBST(INC_AMINCLUDE)
+])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_append_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+# Appends the specified data to the specified file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# 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 7
+
+AC_DEFUN([AX_APPEND_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+printf "$2" >> "$1"
+])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_count_cpus.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_COUNT_CPUS
+#
+# DESCRIPTION
+#
+# Attempt to count the number of processors present on the machine. If the
+# detection fails, then a value of 1 is assumed.
+#
+# The value is placed in the CPU_COUNT variable.
+#
+# LICENSE
+#
+# Copyright (c) 2012 Brian Aker <brian@tangent.org>
+# Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
+# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+# 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 10
+
+ AC_DEFUN([AX_COUNT_CPUS],[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_PROG_EGREP])
+ AC_MSG_CHECKING([the number of available CPUs])
+ CPU_COUNT="0"
+
+ AS_CASE([$host_os],[
+ *darwin*],[
+ AS_IF([test -x /usr/sbin/sysctl],[
+ sysctl_a=`/usr/sbin/sysctl -a 2>/dev/null| grep -c hw.cpu`
+ AS_IF([test sysctl_a],[
+ CPU_COUNT=`/usr/sbin/sysctl -n hw.ncpu`
+ ])
+ ])],[
+ *linux*],[
+ AS_IF([test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo],[
+ AS_IF([test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo],[
+ CPU_COUNT=`$EGREP -c '^processor' /proc/cpuinfo`
+ ])
+ ])
+ ])
+
+ AS_IF([test "x$CPU_COUNT" = "x0"],[
+ CPU_COUNT="1"
+ AC_MSG_RESULT( [unable to detect (assuming 1)] )
+ ],[
+ AC_MSG_RESULT( $CPU_COUNT )
+ ])
+ ])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_file_escapes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_FILE_ESCAPES
+#
+# DESCRIPTION
+#
+# Writes the specified data to the specified file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# 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 7
+
+AC_DEFUN([AX_FILE_ESCAPES],[
+AX_DOLLAR="\$"
+AX_SRB="\\135"
+AX_SLB="\\133"
+AX_BS="\\\\"
+AX_DQ="\""
+])
--- /dev/null
+# https://github.com/BrianAker/ddm4
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIBEVENT()
+#
+# DESCRIPTION
+#
+# libevent library
+#
+# LICENSE
+#
+# Copyright (c) 2012 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 1
+
+ AC_DEFUN([AX_LIBEVENT],[
+ AC_CACHE_CHECK([test for a working libevent], [ax_cv_libevent], [
+ AX_SAVE_FLAGS
+ LIBS="-levent $LIBS"
+ AC_LANG_PUSH([C])
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([#include <event.h>], [
+ struct event_base *tmp_event= event_init();
+ event_base_free(tmp_event);
+ ])],
+ [ax_cv_libevent=yes],
+ [ax_cv_libevent=no],
+ [AC_MSG_WARN([test program execution failed])])
+ AC_LANG_POP
+ AX_RESTORE_FLAGS
+ ])
+
+ AS_IF([test "x$ax_cv_libevent" = "xyes"],[
+ LIBEVENT_LDFLAGS="-levent"
+ AC_SUBST(LIBEVENT_LDFLAGS)
+ AC_DEFINE([HAVE_LIBEVENT],[1],[Define if event_init is present in event.h.])],[
+ AC_DEFINE([HAVE_LIBEVENT],[0],[Define if event_init is present in event_init.h.])
+ ])
+
+ AM_CONDITIONAL(HAVE_LIBEVENT, test "x$ax_cv_libevent" = "xyes")
+ ])
+
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_print_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PRINT_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+# Writes the specified data to the specified file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# 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 7
+
+AC_DEFUN([AX_PRINT_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+printf "$2" > "$1"
+])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_restore_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_RESTORE_FLAGS()
+#
+# DESCRIPTION
+#
+# Restore common compilation flags from temporary variables
+#
+# LICENSE
+#
+# Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
+#
+# 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 3
+
+AC_DEFUN([AX_RESTORE_FLAGS], [
+ CPPFLAGS="${CPPFLAGS_save}"
+ CFLAGS="${CFLAGS_save}"
+ CXXFLAGS="${CXXFLAGS_save}"
+ OBJCFLAGS="${OBJCFLAGS_save}"
+ LDFLAGS="${LDFLAGS_save}"
+ LIBS="${LIBS_save}"
+])
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_save_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SAVE_FLAGS()
+#
+# DESCRIPTION
+#
+# Save common compilation flags into temporary variables
+#
+# LICENSE
+#
+# Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
+#
+# 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 3
+
+AC_DEFUN([AX_SAVE_FLAGS], [
+ CPPFLAGS_save="${CPPFLAGS}"
+ CFLAGS_save="${CFLAGS}"
+ CXXFLAGS_save="${CXXFLAGS}"
+ OBJCFLAGS_save="${OBJCFLAGS}"
+ LDFLAGS_save="${LDFLAGS}"
+ LIBS_save="${LIBS}"
+])