cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob 9fb61cd05e0c7ed89b83a1ea2ae4d4b8007c8ccd 7721 bytes (raw)
$ git show empty-header-values:Makefile.am	# shows this blob on the CLI

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
 
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
AM_CFLAGS = $(WARN_CFLAGS) $(GCC_ATOMICS_CFLAGS) $(PTHREAD_CFLAGS)
AM_LDFLAGS = $(LIBGNU_LIBDEPS)
DTRACE = @DTRACE@
SUBDIRS = lib

# slow.mk is auto-generated by the maintainer (see GNUmakefile)
include $(top_srcdir)/test/slow.mk

mog_src =
mog_src += accept.c
mog_src += accept_loop.c
mog_src += activeq.h
mog_src += addrinfo.c
mog_src += alloc.c
mog_src += bind_listen.c
mog_src += bsd/queue_safe.h
mog_src += bsd/simpleq.h
mog_src += canonpath.c
mog_src += cfg.c
mog_src += cfg.h
mog_src += cfg_validate.c
mog_src += cloexec_detect.c
mog_src += cloexec_from.c
mog_src += close.c
mog_src += cmogstored.h
mog_src += compat_accept.h
mog_src += compat_epoll_pwait.h
mog_src += compat_memstream.h
mog_src += compat_sendfile.h
mog_src += defaults.h
mog_src += dev.c
mog_src += digest.c
mog_src += digest.h
mog_src += exit.c
mog_src += fadvise.h
mog_src += fdmap.c
mog_src += fdmap.h
mog_src += file.c
mog_src += fs.c
mog_src += fs.h
mog_src += gcc.h
mog_src += http.c
mog_src += http.h
mog_src += http_date.c
mog_src += http_dav.c
mog_src += http_get.c
mog_src += http_put.c
mog_src += http_util.h
mog_src += inherit.c
mog_src += ioprio.h
mog_src += ioprio_linux.h
mog_src += ioq.c
mog_src += iostat.c
mog_src += iostat.h
mog_src += iostat_process.c
mog_src += ioutil.c
mog_src += iov_str.h
mog_src += listen_parser.h
mog_src += listen_parser_internal.c
mog_src += maxconns.c
mog_src += mgmt.c
mog_src += mgmt.h
mog_src += mgmt_fn.c
mog_src += mkpath_for.c
mog_src += mnt.c
mog_src += mnt.h
mog_src += mnt_usable.c
mog_src += nameinfo.c
mog_src += nostd/setproctitle.h
mog_src += notify.c
mog_src += notify.h
mog_src += packaddr.h
mog_src += path_parser.h
mog_src += pidfile.c
mog_src += process.c
mog_src += queue_common.c
mog_src += queue_epoll.c
mog_src += queue_epoll.h
mog_src += queue_kqueue.c
mog_src += queue_kqueue.h
mog_src += queue_loop.c
mog_src += queue_step.c
mog_src += selfwake.h
mog_src += selfwake.c
mog_src += sig.c
mog_src += svc.c
mog_src += svc_dev.c
mog_src += thrpool.c
mog_src += trace.h
mog_src += trywrite.c
mog_src += util.h
mog_src += upgrade.c
mog_src += yield.c

LDADD = $(LIBINTL) $(top_builddir)/lib/libgnu.a libnostd.a $(LIB_CLOCK_GETTIME)
noinst_LIBRARIES = libnostd.a
nostd_include = -include $(top_builddir)/$(CONFIG_HEADER)
libnostd_a_SOURCES = nostd/setproctitle.c nostd/setproctitle_noop.c
libnostd_a_CFLAGS = $(AM_CFLAGS) $(nostd_include) $(NOSTD_CFLAGS)

RLFLAGS = -G2 -e
RAGEL = ragel
RL_MAIN = cfg_parser.rl iostat_parser.rl listen_parser.rl mgmt_parser.rl \
          valid_path.rl http_parser.rl chunk_parser.rl valid_put_path.rl
RL_CGEN = $(RL_MAIN:.rl=.c)
RL_ALL = listen_parser_common.rl http_common.rl path_parser.rl $(RL_MAIN)

cfg_parser.c: cfg_parser.rl listen_parser_common.rl
listen_parser.c: listen_parser.rl listen_parser_common.rl
http_parser.c: http_parser.rl http_common.rl path_parser.rl
mgmt_parser.c: path_parser.rl
chunk_parser.c: chunk_parser.rl http_common.rl
.rl.c:
	$(AM_V_GEN)$(RAGEL) $< -C $(RLFLAGS) -o $@

BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.gnulib-version
bin_PROGRAMS = cmogstored
cmogstored_SOURCES = $(mog_src) $(RL_CGEN) cmogstored.c probes.d

RUBY = ruby
PERL = perl
PROVE = prove
TEST_EXTENSIONS = .rb .slowrb .perl
RB_LOG_COMPILER = $(RUBY)
AM_RB_LOG_FLAGS = -I$(top_srcdir)
RB_LOG_FLAGS = -w
PERL_TESTS = test/mogilefs_integration.perl
PERL_LOG_COMPILER = $(PROVE)
PERL_LOG_FLAGS = -v
SLOWRB_LOG_COMPILER = env RUBY=$(RUBY) top_srcdir=$(top_srcdir) $(SHELL)
AM_SLOWRB_LOG_FLAGS = -u -e
include $(top_srcdir)/test/ruby.mk
check_tests = test/valid-path-1 test/trywrite-1 \
  test/cfg-parser-1 test/fdmap-1 test/thrpool-1 \
  test/queue-idle-1 \
  test/http-parser-1 test/chunk-parser-1 \
  test/ioutil-1
check_PROGRAMS = $(check_tests)

TESTS = $(SLOW_RB_FILES) $(RB_TESTS_FAST) $(check_tests) $(PERL_TESTS)

# we need TMPDIR to work in a place where iostat(1) gives stats
test_tmpdir = $(top_builddir)/tmp

$(RB_TESTS:.rb=.log): $(bin_PROGRAMS) $(test_tmpdir)/.stamp
$(PERL_TESTS:.perl=.log): $(bin_PROGRAMS) $(test_tmpdir)/.stamp

$(test_tmpdir)/.stamp:
	@mkdir -p $(test_tmpdir) && > $@

test_COMMON = $(mog_src) $(RL_CGEN) check.h probes.d

test_valid_path_1_SOURCES = test/valid-path-1.c $(test_COMMON)
test_trywrite_1_SOURCES = test/trywrite-1.c $(test_COMMON)
test_cfg_parser_1_SOURCES = test/cfg-parser-1.c $(test_COMMON)
test_fdmap_1_SOURCES = test/fdmap-1.c $(test_COMMON)
test_thrpool_1_SOURCES = test/thrpool-1.c $(test_COMMON)
test_queue_idle_1_SOURCES = test/queue-idle-1.c $(test_COMMON)
test_http_parser_1_SOURCES = test/http-parser-1.c $(test_COMMON)
test_chunk_parser_1_SOURCES = test/chunk-parser-1.c $(test_COMMON)
test_ioutil_1_SOURCES = test/ioutil-1.c $(test_COMMON)

if HAVE_LD_WRAP
if HAVE_EPOLL
check_PROGRAMS += test/epoll-wrap
test_epoll_wrap_SOURCES = $(cmogstored_SOURCES) test/epoll-wrap.c
test_epoll_wrap_LDFLAGS = $(cmogstored_LDFLAGS) $(AM_LDFLAGS) \
                          -Wl,--wrap=epoll_ctl -Wl,--wrap=epoll_create
endif # HAVE_EPOLL

check_PROGRAMS += test/pwrite-wrap
test_pwrite_wrap_SOURCES = $(cmogstored_SOURCES) test/pwrite-wrap.c
test_pwrite_wrap_LDFLAGS = $(cmogstored_LDFLAGS) $(AM_LDFLAGS) \
                          -Wl,--wrap=pwrite

endif # HAVE_LD_WRAP

HELP2MAN = help2man
dist_man_MANS = cmogstored.1

cmogstored.1: cmogstored.x cmogstored.c
.x.1:
	$(AM_V_GEN)if test -f $(top_builddir)/cmogstored; then \
	$(HELP2MAN) -i $< -N $(top_builddir)/cmogstored > $@.$$$$ && \
	mv $@.$$$$ $@; fi

extra_doc = HACKING NEWS ChangeLog TODO
RAKE = rake
$(top_srcdir)/NEWS: configure.ac
	$(AM_V_GEN)$(RAKE) -sq news > $@.$$$$ && mv $@.$$$$ $@
$(top_srcdir)/ChangeLog: configure.ac
	$(AM_V_GEN)$(RAKE) -sq changelog > $@.$$$$ && mv $@.$$$$ $@

RSYNC = rsync
RSYNC_DEST = bogomips.org:/srv/bogomips/cmogstored/
WWW_DOC = README AUTHORS NEWS.atom.xml INSTALL $(extra_doc)
NEWS.atom.xml: configure.ac
	$(AM_V_GEN)$(RAKE) -sq news_atom > $@.$$$$ && mv $@.$$$$ $@
publish: NEWS.atom.xml NEWS ChangeLog
	mkdir -p www/
	-git set-file-times
	$(INSTALL_DATA) -p $(WWW_DOC) www/
	for i in $$(git ls-files doc/); do $(INSTALL_DATA) -p $$i www/; done
	$(RSYNC) -av www/ $(RSYNC_DEST)

.PHONY: publish

tap_support = tapset/all.stp tapset/http_access_log.gawk tapset/ioq_wait.awk

EXTRA_DIST = $(RB_TESTS) $(RL_CGEN) $(RL_ALL) $(PERL_TESTS) $(extra_doc) \
  .gitignore Rakefile autogen.sh GNUmakefile bsd/README doc m4 \
  test/test_helper.rb test/iostat-mock.rb \
  test/.gitignore test/gen-slow.sh test/slow.mk \
  cmogstored.x .ctags $(SLOW_RB_FILES) \
  build-aux/.gitignore build-aux/snippet/.gitignore \
  tests/.gitignore \
  $(top_srcdir)/.version $(top_srcdir)/.gnulib-version \
  test/valgrind.supp nostd/README \
  $(tap_support)

TESTS_ENVIRONMENT = PATH=$(top_builddir):$$PATH TMPDIR=$(test_tmpdir)

VALGRIND = valgrind -v --show-reachable=yes --leak-check=yes \
           --track-origins=yes --error-exitcode=126 \
           --suppressions=$(top_srcdir)/test/valgrind.supp
VALGRIND_CHECK = check
check-valgrind:
	VALGRIND="$(VALGRIND)" $(MAKE) $(VALGRIND_CHECK)

CLEANFILES = -r $(test_tmpdir) $(top_srcdir)/tmp
MAINTAINERCLEANFILES = $(dist_man_MANS)
include $(top_srcdir)/build-aux/coverage.mk
include $(top_srcdir)/build-aux/release.mk
include $(top_srcdir)/build-aux/sparse.mk
include $(top_srcdir)/build-aux/pgo.mk

$(top_srcdir)/.version:
	echo $(VERSION) > $@-t && mv $@-t $@
$(top_srcdir)/.gnulib-version:
	cd $(top_srcdir) && ./autogen.sh
dist-hook:
	echo $(VERSION) > $(distdir)/.tarball-version

if ENABLE_SYSTEMTAP
probes.h: probes.d
	$(DTRACE) -C -h -s $< -o $@

probes.o: probes.d
	$(DTRACE) -C -G -s $< -o $@

EXTRA_DIST += probes.h
BUILT_SOURCES += probes.h
LDADD += probes.o
endif

git clone https://yhbt.net/cmogstored.git