Skip to content

Commit

Permalink
Move to pandora build
Browse files Browse the repository at this point in the history
Change-Id: I2abaad1ecc38ade465f0a65a772bbb9629c8ae0d
Reviewed-on: http://review.northscale.com/1551
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information
trondn authored and steveyen committed Aug 4, 2010
1 parent 641c208 commit 6fcace5
Show file tree
Hide file tree
Showing 212 changed files with 328 additions and 70,663 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,8 @@ moxi_*.tar.gz
stamp-h1
stamp-h2
tags
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
89 changes: 34 additions & 55 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4 --force

bin_PROGRAMS = moxi
noinst_PROGRAMS = moxi-debug sizes testapp timedrun

## INCLUDES is apparently not previously set, if you set it
## change this
INCLUDES = $(CONFLATE_CFLAGS)
LIBS += $(CONFLATE_LIBS)
noinst_PROGRAMS =
if BUILD_TESTAPPS
noinst_PROGRAMS += sizes testapp timedrun
endif

BUILT_SOURCES =

Expand All @@ -18,7 +17,7 @@ moxi_SOURCES = memcached.c memcached.h \
slabs.c slabs.h \
items.c items.h \
assoc.c assoc.h \
thread.c daemon.c \
thread.c \
stats.c stats.h \
util.c util.h \
trace.h cache.h \
Expand All @@ -41,18 +40,22 @@ moxi_SOURCES = memcached.c memcached.h \
log.c log.h \
cJSON.c cJSON.h

if BUILD_DAEMON
moxi_SOURCES += daemon.c
endif

timedrun_SOURCES = timedrun.c

TESTS = check_util check_moxi check_work
if BUILD_WITH_CONFLATE
if HAVE_LIBCONFLATE
TESTS += check_moxi_agent
endif

check_PROGRAMS = check_util \
check_moxi \
check_work

if BUILD_WITH_CONFLATE
if HAVE_LIBCONFLATE
check_PROGRAMS += check_moxi_agent
endif

Expand All @@ -68,60 +71,36 @@ moxi_SOURCES += cache.c
testapp_SOURCES += cache.c
endif

if BUILD_WITH_CONFLATE
if HAVE_LIBCONFLATE
moxi_SOURCES += agent.h agent_config.c agent_ping.c agent_stats.c
endif

if BUILD_SOLARIS_PRIVS
moxi_SOURCES += solaris_priv.c
endif

moxi_debug_SOURCES = $(moxi_SOURCES)
moxi_debug_CPPFLAGS = -DCONFLATE_DB_PATH=\"$(CONFLATE_DB_PATH)\"
moxi_CPPFLAGS = -DNDEBUG $(moxi_debug_CPPFLAGS)
moxi_debug_LDADD = @PROFILER_LDFLAGS@
moxi_debug_CFLAGS = @PROFILER_FLAGS@

moxi_CPPFLAGS = -DNDEBUG -DCONFLATE_DB_PATH=\"$(CONFLATE_DB_PATH)\"
moxi_LDADD =
moxi_LDFLAGS = $(LTLIBEVENT) $(LTLIBCONFLATE) $(LTLIBHASHKIT)
moxi_DEPENDENCIES =
moxi_debug_DEPENDENCIES =

CLEANFILES=

if BUILD_DTRACE
BUILT_SOURCES += memcached_dtrace.h
CLEANFILES += memcached_dtrace.h
endif

if DTRACE_INSTRUMENT_OBJ
moxi_LDADD += memcached_dtrace.o
moxi_DEPENDENCIES += memcached_dtrace.o
moxi_debug_LDADD += memcached_debug_dtrace.o
moxi_debug_DEPENDENCIES += memcached_debug_dtrace.o
CLEANFILES += memcached_dtrace.o memcached_debug_dtrace.o
if MOXI_USE_VBUCKET
moxi_LDFLAGS += $(LTLIBVBUCKET)
else
moxi_LDFLAGS += $(LTLIBMEMCACHED)
endif

memcached_dtrace.h: memcached_dtrace.d
${DTRACE} -h -s memcached_dtrace.d
sed -e 's,void \*,const void \*,g' memcached_dtrace.h | \
sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > mmc_dtrace.tmp
mv mmc_dtrace.tmp memcached_dtrace.h

memcached_dtrace.o: $(moxi_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_dtrace.o -s ${srcdir}/memcached_dtrace.d $(moxi_OBJECTS)

memcached_debug_dtrace.o: $(moxi_debug_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_debug_dtrace.o -s ${srcdir}/memcached_dtrace.d $(moxi_debug_OBJECTS)
CLEANFILES=

SUBDIRS = doc $(MAYBE_LIBCONFLATE)
DIST_SUBDIRS = doc $(MAYBE_LIBCONFLATE)
DIST_DIRS = scripts
EXTRA_DIST = doc scripts TODO t memcached_dtrace.d m4/version.m4 protocol_binary.h patches debian
EXTRA_DIST = doc scripts TODO t m4/version.m4 protocol_binary.h patches debian

MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov

memcached-debug: moxi-debug
cp moxi-debug memcached-debug
memcached-debug: moxi
cp moxi memcached-debug

test: memcached-debug sizes testapp
$(srcdir)/sizes
Expand Down Expand Up @@ -164,22 +143,22 @@ dist-hook:
install-data-hook:
$(mkdir_p) $(DESTDIR)$(CONFLATE_DB_PATH)

check_work_SOURCES = check_work.c $(moxi_debug_SOURCES)
check_work_CFLAGS = @CHECK_CFLAGS@ $(moxi_debug_CPPFLAGS) -DMAIN_CHECK
check_work_LDADD = @CHECK_LIBS@ $(moxi_debug_LDADD)
check_work_SOURCES = check_work.c $(moxi_SOURCES)
check_work_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK
check_work_LDADD = @CHECK_LIBS@ $(moxi_LDADD)

check_moxi_SOURCES = check_moxi.c $(moxi_debug_SOURCES)
check_moxi_CFLAGS = @CHECK_CFLAGS@ $(moxi_debug_CPPFLAGS) -DMAIN_CHECK
check_moxi_LDADD = @CHECK_LIBS@ $(moxi_debug_LDADD)
check_moxi_SOURCES = check_moxi.c $(moxi_SOURCES)
check_moxi_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK
check_moxi_LDADD = @CHECK_LIBS@ $(moxi_LDADD)

if BUILD_WITH_CONFLATE
check_moxi_agent_SOURCES = check_moxi_agent.c redirects.c $(moxi_debug_SOURCES)
check_moxi_agent_CFLAGS = @CHECK_CFLAGS@ $(moxi_debug_CPPFLAGS) -DMAIN_CHECK -DREDIRECTS_FOR_MOCKS
check_moxi_agent_LDADD = @CHECK_LIBS@ $(moxi_debug_LDADD)
if HAVE_LIBCONFLATE
check_moxi_agent_SOURCES = check_moxi_agent.c redirects.c $(moxi_SOURCES)
check_moxi_agent_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK -DREDIRECTS_FOR_MOCKS
check_moxi_agent_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
endif

check-syntax:
$(COMPILE) $(moxi_debug_CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}
$(COMPILE) $(moxi_CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}

fc_rpm_inner:
-rm $(rpmtop)/SRPMS/moxi-$(VERSION)*.rpm
Expand Down
2 changes: 1 addition & 1 deletion agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef AGENT_H
#define AGENT_H

#include <conflate.h>
#include <libconflate/conflate.h>
#ifdef REDIRECTS_FOR_MOCKS
#include "redirects.h"
#endif
Expand Down
3 changes: 1 addition & 2 deletions agent_config.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sysexits.h>
#include <pthread.h>
#include <assert.h>
#include "memcached.h"
Expand Down
3 changes: 1 addition & 2 deletions agent_ping.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sysexits.h>
#include <pthread.h>
#include <assert.h>
#include "memcached.h"
Expand Down
5 changes: 2 additions & 3 deletions agent_stats.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sysexits.h>
#include <pthread.h>
#include <assert.h>
#include <math.h>
#include <libconflate/conflate.h>
#include "memcached.h"
#include "conflate.h"
#include "cproxy.h"
#include "work.h"
#include "agent.h"
Expand Down
5 changes: 0 additions & 5 deletions assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

#include "memcached.h"
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef CACHE_H
#define CACHE_H
#include "config.h"
#include <pthread.h>

#ifdef HAVE_UMEM_H
Expand Down
93 changes: 93 additions & 0 deletions config_static.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2010 NorthScale, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CONFIG_STATIC_H
#define CONFIG_STATIC_H 1

// The intention of this file is to avoid cluttering the code with #ifdefs

#ifdef WIN32
// HAVE_CONFIG_H is causing problems with pthreads.h on in32
#undef HAVE_CONFIG_H

#define _WIN32_WINNT 0x0501
#include <winsock2.h>
#include <ws2tcpip.h>

struct iovec {
size_t iov_len;
void* iov_base;
};

#include "win32/win32.h"

#define EX_USAGE EXIT_FAILURE
#define EX_OSERR EXIT_FAILURE

#else
#define initialize_sockets()
#endif

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

#ifdef HAVE_PWD_H
#include <pwd.h>
#endif

#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif

#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif

#ifdef HAVE_SYSEXITS_H
#include <sysexits.h>
#endif

#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif

#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif

#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif

#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif


#endif
Loading

0 comments on commit 6fcace5

Please sign in to comment.