~jan-kneschke/mysql-proxy/packet-tracking-assertions

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
#  $%BEGINLICENSE%$
#  Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
# 
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License as
#  published by the Free Software Foundation; version 2 of the
#  License.
# 
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
# 
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
#  02110-1301  USA
# 
#  $%ENDLICENSE%$
luaextdir = ${pkglibdir}/lua
plugindir = ${pkglibdir}/plugins


BUILD_CPPFLAGS = $(LUA_CFLAGS) $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(GTHREAD_CFLAGS)
BUILD_CFLAGS   = -DLUAEXTDIR="\"$(luaextdir)\""  -DPLUGINDIR="\"$(plugindir)\""
BUILD_LDADD    = $(GLIB_LIBS) $(GMODULE_LIBS) libmysql-chassis.la $(GTHREAD_LIBS) libmysql-proxy.la

BUILT_SOURCES =
if USE_WRAPPER_SCRIPT
## we are self-contained
## put all the binaries into a "hidden" location, the wrapper scripts are in ./scripts/
libexec_PROGRAMS = mysql-binlog-dump mysql-proxy mysql-myisam-dump
else
bin_PROGRAMS            = mysql-binlog-dump mysql-myisam-dump mysql-proxy
endif

mysql_proxy_SOURCES		= mysql-proxy-cli.c
mysql_proxy_CPPFLAGS	= $(BUILD_CPPFLAGS)
mysql_proxy_CFLAGS		= $(BUILD_CFLAGS)
mysql_proxy_LDADD		= $(BUILD_LDADD)

mysql_binlog_dump_SOURCES	= mysql-binlog-dump.c
mysql_binlog_dump_CPPFLAGS	= $(BUILD_CPPFLAGS)
mysql_binlog_dump_CFLAGS	= $(BUILD_CFLAGS)
mysql_binlog_dump_LDADD		= $(BUILD_LDADD)

mysql_myisam_dump_SOURCES	= mysql-myisam-dump.c
mysql_myisam_dump_CPPFLAGS	= $(BUILD_CPPFLAGS)
mysql_myisam_dump_CFLAGS	= $(BUILD_CFLAGS)
mysql_myisam_dump_LDADD		= $(BUILD_LDADD)

lib_LTLIBRARIES = 

# functionality extending what's currently in glib
lib_LTLIBRARIES += libmysql-chassis-glibext.la
libmysql_chassis_glibext_la_SOURCES = \
	glib-ext.c \
	glib-ext-ref.c

libmysql_chassis_glibext_la_LDFLAGS  = -export-dynamic -no-undefined -dynamic
libmysql_chassis_glibext_la_CPPFLAGS = $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS)
libmysql_chassis_glibext_la_LIBADD   = $(GLIB_LIBS)

# library implementing timing functionality
lib_LTLIBRARIES += libmysql-chassis-timing.la
libmysql_chassis_timing_la_SOURCES = \
	chassis-timings.c \
	chassis-gtimeval.c \
	my_rdtsc.c

libmysql_chassis_timing_la_LDFLAGS  = -export-dynamic -no-undefined -dynamic
libmysql_chassis_timing_la_CPPFLAGS = $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(LUA_CFLAGS) $(GMODULE_CFLAGS)
libmysql_chassis_timing_la_LIBADD   = $(GLIB_LIBS) libmysql-chassis-glibext.la
if USE_SUNCC_ASSEMBLY
libmysql_chassis_timing_la_CPPFLAGS += \
	$(top_srcdir)/src/my_timer_cycles.il
endif


## the core library
lib_LTLIBRARIES += libmysql-chassis.la
libmysql_chassis_la_SOURCES = \
	lua-load-factory.c \
	lua-scope.c \
	chassis-plugin.c \
	chassis-log.c \
	chassis-mainloop.c \
	chassis-event-thread.c \
	chassis-keyfile.c \
	chassis-path.c \
	chassis-filemode.c \
	chassis-limits.c \
	chassis-shutdown-hooks.c \
	chassis-stats.c \
	chassis-frontend.c \
	chassis-options.c \
	chassis-unix-daemon.c \
	chassis-win32-service.c


libmysql_chassis_la_LDFLAGS  = -export-dynamic -no-undefined -dynamic
libmysql_chassis_la_CPPFLAGS = $(MYSQL_CFLAGS) $(EVENT_CFLAGS) $(GLIB_CFLAGS) $(LUA_CFLAGS) $(GMODULE_CFLAGS) $(GTHREAD_CFLAGS)
libmysql_chassis_la_LIBADD   = $(EVENT_LIBS)   $(GLIB_LIBS)   $(LUA_LIBS) $(GMODULE_LIBS) $(GTHREAD_LIBS) libmysql-chassis-timing.la libmysql-chassis-glibext.la

lib_LTLIBRARIES += libmysql-proxy.la
libmysql_proxy_la_SOURCES = \
	network-mysqld.c \
	network-mysqld-lua.c \
	network-mysqld-proto.c \
	network-mysqld-binlog.c \
	network-mysqld-packet.c \
	network-mysqld-masterinfo.c \
	network-conn-pool.c  \
	network-conn-pool-lua.c  \
	network-queue.c \
	network-socket.c \
	network-socket-lua.c \
	network-address.c \
	network-address-lua.c \
	network-injection.c \
	network-injection-lua.c \
	network-backend.c \
	network-backend-lua.c \
	lua-env.c

libmysql_proxy_la_LDFLAGS  = -export-dynamic -no-undefined -dynamic
libmysql_proxy_la_CPPFLAGS = $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(LUA_CFLAGS) $(GMODULE_CFLAGS)
libmysql_proxy_la_LIBADD   = $(EVENT_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) libmysql-chassis.la libmysql-chassis-timing.la libmysql-chassis-glibext.la

## should be packaged, but not installed
noinst_HEADERS=\
	network-debug.h

include_HEADERS=\
	network-mysqld.h \
	network-mysqld-lua.h \
	network-mysqld-proto.h \
	network-mysqld-binlog.h \
	network-mysqld-packet.h \
	network-mysqld-masterinfo.h \
	network-conn-pool.h \
	network-conn-pool-lua.h \
	network-queue.h \
	network-socket.h \
	network-socket-lua.h \
	network-address.h \
	network-address-lua.h \
	sys-pedantic.h \
	chassis-plugin.h \
	chassis-log.h \
	chassis-keyfile.h \
	chassis-mainloop.h \
	chassis-path.h \
	chassis-filemode.h \
	chassis-limits.h \
	chassis-event-thread.h \
	chassis-gtimeval.h \
	glib-ext.h \
	glib-ext-ref.h \
	string-len.h \
	lua-load-factory.h \
	lua-scope.h \
	lua-env.h \
	network-injection.h \
	network-injection-lua.h \
	chassis-shutdown-hooks.h \
	chassis-exports.h \
	network-exports.h \
	network-backend.h \
	network-backend-lua.h \
	disable-dtrace.h \
	lua-registry-keys.h \
	chassis-stats.h \
	chassis-timings.h \
	chassis-frontend.h \
	chassis-options.h \
	chassis-win32-service.h \
	chassis-unix-daemon.h \
	my_rdtsc.h

if ENABLE_DTRACE

BUILT_SOURCES += proxy-dtrace-provider.h
nodist_libmysql_proxy_la_SOURCES = proxy-dtrace-provider.h
CLEANFILES = proxy-dtrace-provider.h

proxy-dtrace-provider.h: Makefile
	$(DTRACE) -h -s $(top_srcdir)/src/proxy-dtrace-provider.d -o $(top_builddir)/src/proxy-dtrace-provider.h

## Solaris DTrace needs to perform some link time operations at probe sites.
## On OS X this is performed automagically (and dtrace(1M) doesn't even have -G)
if OS_SOLARIS

proxy-dtrace-provider.o: proxy-dtrace-provider.h $(libmysql_proxy_la_OBJECTS)
	$(DTRACE) -G -s $(top_srcdir)/src/proxy-dtrace-provider.d -o $(top_builddir)/src/proxy-dtrace-provider.o \
	    $(libmysql_proxy_la_OBJECTS:%.lo=.libs/%.o)


libmysql_proxy_la_LIBADD += proxy-dtrace-provider.o
endif

endif

## for now test-latency uses macros with var-args which isn't supported on
## some compilers. Include the source in tar.gz, but don't build it by default
# noinst_PROGRAMS=test-latency 
# test_latency_SOURCES=test-latency.c
# test_latency_CPPFLAGS= $(MYSQL_INCLUDE) $(GLIB_CFLAGS)
# test_latency_LDADD= $(MYSQL_LIBS) $(GLIB_LIBS)

EXTRA_DIST=test-latency.c proxy-dtrace-provider.d CMakeLists.txt my_timer_cycles.il