Skip to content

Commit 6fcace5

Browse files
trondnsteveyen
authored andcommitted
Move to pandora build
Change-Id: I2abaad1ecc38ade465f0a65a772bbb9629c8ae0d Reviewed-on: http://review.northscale.com/1551 Reviewed-by: Steve Yen <[email protected]> Tested-by: Aliaksey Kandratsenka <[email protected]>
1 parent 641c208 commit 6fcace5

File tree

212 files changed

+328
-70663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+328
-70663
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,8 @@ moxi_*.tar.gz
6767
stamp-h1
6868
stamp-h2
6969
tags
70+
m4/libtool.m4
71+
m4/ltoptions.m4
72+
m4/ltsugar.m4
73+
m4/ltversion.m4
74+
m4/lt~obsolete.m4

Makefile.am

+34-55
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
AUTOMAKE_OPTIONS = foreign
2+
ACLOCAL_AMFLAGS = -I m4 --force
23

34
bin_PROGRAMS = moxi
4-
noinst_PROGRAMS = moxi-debug sizes testapp timedrun
5-
6-
## INCLUDES is apparently not previously set, if you set it
7-
## change this
8-
INCLUDES = $(CONFLATE_CFLAGS)
9-
LIBS += $(CONFLATE_LIBS)
5+
noinst_PROGRAMS =
6+
if BUILD_TESTAPPS
7+
noinst_PROGRAMS += sizes testapp timedrun
8+
endif
109

1110
BUILT_SOURCES =
1211

@@ -18,7 +17,7 @@ moxi_SOURCES = memcached.c memcached.h \
1817
slabs.c slabs.h \
1918
items.c items.h \
2019
assoc.c assoc.h \
21-
thread.c daemon.c \
20+
thread.c \
2221
stats.c stats.h \
2322
util.c util.h \
2423
trace.h cache.h \
@@ -41,18 +40,22 @@ moxi_SOURCES = memcached.c memcached.h \
4140
log.c log.h \
4241
cJSON.c cJSON.h
4342

43+
if BUILD_DAEMON
44+
moxi_SOURCES += daemon.c
45+
endif
46+
4447
timedrun_SOURCES = timedrun.c
4548

4649
TESTS = check_util check_moxi check_work
47-
if BUILD_WITH_CONFLATE
50+
if HAVE_LIBCONFLATE
4851
TESTS += check_moxi_agent
4952
endif
5053

5154
check_PROGRAMS = check_util \
5255
check_moxi \
5356
check_work
5457

55-
if BUILD_WITH_CONFLATE
58+
if HAVE_LIBCONFLATE
5659
check_PROGRAMS += check_moxi_agent
5760
endif
5861

@@ -68,60 +71,36 @@ moxi_SOURCES += cache.c
6871
testapp_SOURCES += cache.c
6972
endif
7073

71-
if BUILD_WITH_CONFLATE
74+
if HAVE_LIBCONFLATE
7275
moxi_SOURCES += agent.h agent_config.c agent_ping.c agent_stats.c
7376
endif
7477

7578
if BUILD_SOLARIS_PRIVS
7679
moxi_SOURCES += solaris_priv.c
7780
endif
7881

79-
moxi_debug_SOURCES = $(moxi_SOURCES)
80-
moxi_debug_CPPFLAGS = -DCONFLATE_DB_PATH=\"$(CONFLATE_DB_PATH)\"
81-
moxi_CPPFLAGS = -DNDEBUG $(moxi_debug_CPPFLAGS)
82-
moxi_debug_LDADD = @PROFILER_LDFLAGS@
83-
moxi_debug_CFLAGS = @PROFILER_FLAGS@
84-
82+
moxi_CPPFLAGS = -DNDEBUG -DCONFLATE_DB_PATH=\"$(CONFLATE_DB_PATH)\"
8583
moxi_LDADD =
84+
moxi_LDFLAGS = $(LTLIBEVENT) $(LTLIBCONFLATE) $(LTLIBHASHKIT)
8685
moxi_DEPENDENCIES =
87-
moxi_debug_DEPENDENCIES =
88-
89-
CLEANFILES=
90-
91-
if BUILD_DTRACE
92-
BUILT_SOURCES += memcached_dtrace.h
93-
CLEANFILES += memcached_dtrace.h
94-
endif
9586

96-
if DTRACE_INSTRUMENT_OBJ
97-
moxi_LDADD += memcached_dtrace.o
98-
moxi_DEPENDENCIES += memcached_dtrace.o
99-
moxi_debug_LDADD += memcached_debug_dtrace.o
100-
moxi_debug_DEPENDENCIES += memcached_debug_dtrace.o
101-
CLEANFILES += memcached_dtrace.o memcached_debug_dtrace.o
87+
if MOXI_USE_VBUCKET
88+
moxi_LDFLAGS += $(LTLIBVBUCKET)
89+
else
90+
moxi_LDFLAGS += $(LTLIBMEMCACHED)
10291
endif
10392

104-
memcached_dtrace.h: memcached_dtrace.d
105-
${DTRACE} -h -s memcached_dtrace.d
106-
sed -e 's,void \*,const void \*,g' memcached_dtrace.h | \
107-
sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > mmc_dtrace.tmp
108-
mv mmc_dtrace.tmp memcached_dtrace.h
109-
110-
memcached_dtrace.o: $(moxi_OBJECTS)
111-
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_dtrace.o -s ${srcdir}/memcached_dtrace.d $(moxi_OBJECTS)
112-
113-
memcached_debug_dtrace.o: $(moxi_debug_OBJECTS)
114-
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_debug_dtrace.o -s ${srcdir}/memcached_dtrace.d $(moxi_debug_OBJECTS)
93+
CLEANFILES=
11594

11695
SUBDIRS = doc $(MAYBE_LIBCONFLATE)
11796
DIST_SUBDIRS = doc $(MAYBE_LIBCONFLATE)
11897
DIST_DIRS = scripts
119-
EXTRA_DIST = doc scripts TODO t memcached_dtrace.d m4/version.m4 protocol_binary.h patches debian
98+
EXTRA_DIST = doc scripts TODO t m4/version.m4 protocol_binary.h patches debian
12099

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

123-
memcached-debug: moxi-debug
124-
cp moxi-debug memcached-debug
102+
memcached-debug: moxi
103+
cp moxi memcached-debug
125104

126105
test: memcached-debug sizes testapp
127106
$(srcdir)/sizes
@@ -164,22 +143,22 @@ dist-hook:
164143
install-data-hook:
165144
$(mkdir_p) $(DESTDIR)$(CONFLATE_DB_PATH)
166145

167-
check_work_SOURCES = check_work.c $(moxi_debug_SOURCES)
168-
check_work_CFLAGS = @CHECK_CFLAGS@ $(moxi_debug_CPPFLAGS) -DMAIN_CHECK
169-
check_work_LDADD = @CHECK_LIBS@ $(moxi_debug_LDADD)
146+
check_work_SOURCES = check_work.c $(moxi_SOURCES)
147+
check_work_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK
148+
check_work_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
170149

171-
check_moxi_SOURCES = check_moxi.c $(moxi_debug_SOURCES)
172-
check_moxi_CFLAGS = @CHECK_CFLAGS@ $(moxi_debug_CPPFLAGS) -DMAIN_CHECK
173-
check_moxi_LDADD = @CHECK_LIBS@ $(moxi_debug_LDADD)
150+
check_moxi_SOURCES = check_moxi.c $(moxi_SOURCES)
151+
check_moxi_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK
152+
check_moxi_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
174153

175-
if BUILD_WITH_CONFLATE
176-
check_moxi_agent_SOURCES = check_moxi_agent.c redirects.c $(moxi_debug_SOURCES)
177-
check_moxi_agent_CFLAGS = @CHECK_CFLAGS@ $(moxi_debug_CPPFLAGS) -DMAIN_CHECK -DREDIRECTS_FOR_MOCKS
178-
check_moxi_agent_LDADD = @CHECK_LIBS@ $(moxi_debug_LDADD)
154+
if HAVE_LIBCONFLATE
155+
check_moxi_agent_SOURCES = check_moxi_agent.c redirects.c $(moxi_SOURCES)
156+
check_moxi_agent_CFLAGS = @CHECK_CFLAGS@ $(moxi_CPPFLAGS) -DMAIN_CHECK -DREDIRECTS_FOR_MOCKS
157+
check_moxi_agent_LDADD = @CHECK_LIBS@ $(moxi_LDADD)
179158
endif
180159

181160
check-syntax:
182-
$(COMPILE) $(moxi_debug_CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}
161+
$(COMPILE) $(moxi_CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}
183162

184163
fc_rpm_inner:
185164
-rm $(rpmtop)/SRPMS/moxi-$(VERSION)*.rpm

agent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef AGENT_H
44
#define AGENT_H
55

6-
#include <conflate.h>
6+
#include <libconflate/conflate.h>
77
#ifdef REDIRECTS_FOR_MOCKS
88
#include "redirects.h"
99
#endif

agent_config.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2-
2+
#include "config.h"
33
#include <stdio.h>
44
#include <stdlib.h>
55
#include <string.h>
66
#include <errno.h>
7-
#include <sysexits.h>
87
#include <pthread.h>
98
#include <assert.h>
109
#include "memcached.h"

agent_ping.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2-
2+
#include "config.h"
33
#include <stdio.h>
44
#include <stdlib.h>
55
#include <string.h>
66
#include <errno.h>
7-
#include <sysexits.h>
87
#include <pthread.h>
98
#include <assert.h>
109
#include "memcached.h"

agent_stats.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2-
2+
#include "config.h"
33
#include <stdio.h>
44
#include <stdlib.h>
55
#include <string.h>
66
#include <unistd.h>
77
#include <errno.h>
8-
#include <sysexits.h>
98
#include <pthread.h>
109
#include <assert.h>
1110
#include <math.h>
11+
#include <libconflate/conflate.h>
1212
#include "memcached.h"
13-
#include "conflate.h"
1413
#include "cproxy.h"
1514
#include "work.h"
1615
#include "agent.h"

assoc.c

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313

1414
#include "memcached.h"
1515
#include <sys/stat.h>
16-
#include <sys/socket.h>
17-
#include <sys/signal.h>
18-
#include <sys/resource.h>
19-
#include <fcntl.h>
20-
#include <netinet/in.h>
2116
#include <errno.h>
2217
#include <stdlib.h>
2318
#include <stdio.h>

cache.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
22
#ifndef CACHE_H
33
#define CACHE_H
4+
#include "config.h"
45
#include <pthread.h>
56

67
#ifdef HAVE_UMEM_H

config_static.h

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2+
/*
3+
* Copyright 2010 NorthScale, Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
#ifndef CONFIG_STATIC_H
18+
#define CONFIG_STATIC_H 1
19+
20+
// The intention of this file is to avoid cluttering the code with #ifdefs
21+
22+
#ifdef WIN32
23+
// HAVE_CONFIG_H is causing problems with pthreads.h on in32
24+
#undef HAVE_CONFIG_H
25+
26+
#define _WIN32_WINNT 0x0501
27+
#include <winsock2.h>
28+
#include <ws2tcpip.h>
29+
30+
struct iovec {
31+
size_t iov_len;
32+
void* iov_base;
33+
};
34+
35+
#include "win32/win32.h"
36+
37+
#define EX_USAGE EXIT_FAILURE
38+
#define EX_OSERR EXIT_FAILURE
39+
40+
#else
41+
#define initialize_sockets()
42+
#endif
43+
44+
#ifdef HAVE_SYS_SOCKET_H
45+
#include <sys/socket.h>
46+
#endif
47+
48+
#ifdef HAVE_NETDB_H
49+
#include <netdb.h>
50+
#endif
51+
52+
#ifdef HAVE_ARPA_INET_H
53+
#include <arpa/inet.h>
54+
#endif
55+
56+
#ifdef HAVE_PWD_H
57+
#include <pwd.h>
58+
#endif
59+
60+
#ifdef HAVE_SYS_MMAN_H
61+
#include <sys/mman.h>
62+
#endif
63+
64+
#ifdef HAVE_NETINET_TCP_H
65+
#include <netinet/tcp.h>
66+
#endif
67+
68+
#ifdef HAVE_SYSEXITS_H
69+
#include <sysexits.h>
70+
#endif
71+
72+
#ifdef HAVE_SYS_UIO_H
73+
#include <sys/uio.h>
74+
#endif
75+
76+
#ifdef HAVE_SYS_UN_H
77+
#include <sys/un.h>
78+
#endif
79+
80+
#ifdef HAVE_SYS_RESOURCE_H
81+
#include <sys/resource.h>
82+
#endif
83+
84+
#ifdef HAVE_NETINET_IN_H
85+
#include <netinet/in.h>
86+
#endif
87+
88+
#ifdef HAVE_SYSLOG_H
89+
#include <syslog.h>
90+
#endif
91+
92+
93+
#endif

0 commit comments

Comments
 (0)