TESTS += ${check_PROGRAMS}
XFAIL_TESTS += ${bin_PROGRAMS}
+if ! BUILD_WIN32
+
merge-clean:
@find ./ | $(GREP) \.gcda | xargs rm -f
@find ./ | $(GREP) \.gcno | xargs rm -f
@echo "Files that need to be either removed or checked in:"
@bzr unknowns
-clean-local:
- -rm -rf docs/_build docs/doctrees
+clean-local: clean-libtest-check clean-docs-check
+
lcov: lcov-clean check
@echo
@rm -rf lcov */lcov.out
@find . -name '*.gcno' | xargs rm -f
@find . -name '*.gcda' | xargs rm -f
+endif
DISTCLEANFILES+= config/top.h
-clean-local: clean-libtest-check clean-docs-check
-
maintainer-clean-local:
find . -type f -name '*~' -exec rm -f '{}' \;
-rm -f @PACKAGE@-*.rpm
# Arguments for configure
local BUILD_CONFIGURE_ARG=
- # Set ENV DEBUG in order to enable debugging
+ # 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'
+ BUILD_CONFIGURE_ARG+=' --enable-debug --enable-assert'
+ elif [[ -n "$VCS_CHECKOUT" ]]; then
+ BUILD_CONFIGURE_ARG+=' --enable-assert'
fi
- # Set ENV ASSERT in order to enable assert
- if [[ -n "$ASSERT" ]]; then
- local ASSERT_ARG=
- ASSERT_ARG='--enable-assert'
- BUILD_CONFIGURE_ARG="$ASSERT_ARG $BUILD_CONFIGURE_ARG"
+ if [[ -n "$CONFIGURE_ARG" ]]; then
+ BUILD_CONFIGURE_ARG+=" $CONFIGURE_ARG"
fi
- if [[ -n "$CONFIGURE_ARG" ]]; then
- BUILD_CONFIGURE_ARG= "$BUILD_CONFIGURE_ARG $CONFIGURE_ARG"
+ if [[ -n "$PREFIX_ARG" ]]; then
+ BUILD_CONFIGURE_ARG+=" $PREFIX_ARG"
fi
ret=1;
# If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
case $HOST_OS in
*-darwin-*)
- CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG $PREFIX_ARG"
+ CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG"
ret=$?
;;
rhel-5*)
command_exists 'gcc44' || die "Could not locate gcc44"
- CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG $PREFIX_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG $PREFIX_ARG"
+ CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG"
ret=$?
;;
*)
- $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG
+ $CONFIGURE $BUILD_CONFIGURE_ARG
ret=$?
;;
esac
if [ $ret -ne 0 ]; then
- die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG"
+ die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG"
fi
if [ ! -f 'Makefile' ]; then
die "OLD_CONFIGURE_ARG($OLD_CONFIGURE_ARG) was set on push, programmer error!"
fi
+ if [[ -n "$OLD_PREFIX" ]]; then
+ die "OLD_PREFIX($OLD_PREFIX) was set on push, programmer error!"
+ fi
+
if [[ -n "$OLD_MAKE" ]]; then
die "OLD_MAKE($OLD_MAKE) was set on push, programmer error!"
fi
CONFIGURE_ARG=$OLD_CONFIGURE_ARG
fi
+ if [[ -n "$OLD_PREFIX" ]]; then
+ CONFIGURE_ARG=$OLD_PREFIX
+ fi
+
if [[ -n "$OLD_MAKE" ]]; then
MAKE=$OLD_MAKE
fi
OLD_CONFIGURE=
OLD_CONFIGURE_ARG=
+ OLD_PREFIX=
OLD_MAKE=
OLD_TESTS_ENVIRONMENT=
VCS_CHECKOUT=svn
elif [[ -d '.hg' ]]; then
VCS_CHECKOUT=hg
+ else
+ VCS_CHECKOUT=
fi
if [[ -n "$VCS_CHECKOUT" ]]; then
local OLD_CONFIGURE=
local OLD_CONFIGURE_ARG=
+ local OLD_PREFIX=
local OLD_MAKE=
local OLD_TESTS_ENVIRONMENT=
*/
static memcached_socket_t set_noblock(void)
{
-#ifdef WIN32
+#if defined(_WIN32)
u_long arg = 1;
if (ioctlsocket(sock, FIONBIO, &arg) == SOCKET_ERROR)
{
void initialize_sockets(void)
{
/* Define the function for all platforms to avoid #ifdefs in each program */
-#if defined(WIN32) && WIN32
+#if defined(_WIN32)
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0)
{
fprintf(stderr, "Socket Initialization Error. Program aborted\n");
exit(EXIT_FAILURE);
}
-#endif
+#endif // #if defined(_WIN32)
}
#pragma once
-#if defined(WIN32) || defined(__MINGW32__)
+#if defined(_WIN32)
# include <winsock2.h>
# include <ws2tcpip.h>
typedef int memcached_socket_t;
-#endif /* WIN32 */
+#endif /* _WIN32 */
# include <dlfcn.h>
#endif
-#if defined(WIN32) || defined(__MINGW32__)
+#if defined(_WIN32)
# include "libmemcached/windows.hpp"
#endif
static inline void set_socket_nonblocking(org::libmemcached::Instance* server)
{
-#ifdef WIN32
+#if defined(_WIN32)
u_long arg= 1;
if (ioctlsocket(server->fd, FIONBIO, &arg) == SOCKET_ERROR)
{
#if defined(_WIN32)
#else
-#if defined(SO_NOSIGPIPE)
+# if defined(SO_NOSIGPIPE)
if (SO_NOSIGPIPE)
{
int set= 1;
#endif
}
}
-#endif // SO_NOSIGPIPE
+# endif // SO_NOSIGPIPE
#endif // _WIN32
if (server->root->flags.no_block)
static memcached_return_t unix_socket_connect(org::libmemcached::Instance* server)
{
-#ifndef WIN32
+#ifndef _WIN32
WATCHPOINT_ASSERT(server->fd == INVALID_SOCKET);
do {
if BUILD_WIN32
libmemcached_libmemcached_la_CFLAGS+= -DBUILDING_HASHKIT
libmemcached_libmemcached_la_CXXFLAGS+= -DBUILDING_HASHKIT
-libmemcached_libmemcached_la_LIBADD+= -lmingw64
-libmemcached_libmemcached_la_LIBADD+= -lws2_64
+libmemcached_libmemcached_la_LIBADD+= -lmingw32
+libmemcached_libmemcached_la_LIBADD+= -lws2_32
endif
libmemcached_libmemcached_la_SOURCES+= libmemcached/instance.cc
#include "libmemcached/common.h"
-#if defined(WIN32) || defined(__MINGW32__)
+#if defined(_WIN32)
#include "libmemcached/poll.h"
#include <sys/time.h>
{
if (fds[x].events & (POLLIN | POLLOUT))
{
-#ifndef WIN32
+#ifndef _WIN32
if (fds[x].fd > maxfd)
{
maxfd= fds[x].fd;
return ret;
}
-#endif // defined(WIN32) || defined(__MINGW32__)
+#endif // defined(_WIN32)
#pragma once
-#if defined(WIN32) || defined(__MINGW32__)
+#if defined(_WIN32)
#include <winsock2.h>
typedef struct pollfd
{
-#ifdef WIN32
+#if defined(_WIN32)
SOCKET fd;
#else
int fd;
}
#endif
-#endif // defined(WIN32) || defined(__MINGW32__)
+#endif // defined(_WIN32)
#pragma once
-#ifndef WIN32
-#include <netdb.h>
+#ifndef _WIN32
+# include <netdb.h>
#endif
#include <sys/types.h>
# include <arpa/inet.h>
#endif
-#if defined(WIN32) || defined(__MINGW32__)
+#if defined(_WIN32)
# include "win32/wrappers.h"
# define get_socket_errno() WSAGetLastError()
#else
void dream(time_t tv_sec, long tv_nsec)
{
-#ifdef WIN32
+#if defined(_WIN32)
if (tv_sec == 0 and tv_nsec)
{
tv_sec++;
# include <string.h>
#endif
-#ifdef _WIN32
+#if defined(_WIN32)
# include <malloc.h>
#else
# include <alloca.h>