Makefile.am 38 KB
Newer Older
1 2
ACLOCAL_AMFLAGS = -I config

3 4
SUBDIRS = doc

5
DIST_SUBDIRS = doc builds builds/deprecated-msvc
6 7 8

pkgconfig_DATA = src/libzmq.pc

9 10 11 12 13 14 15
AM_CPPFLAGS = \
	-I$(top_builddir)/include \
	-I$(top_srcdir)/include

#
# libraries/binaries
#
16
lib_LTLIBRARIES = src/libzmq.la
17 18

include_HEADERS = \
Min RK's avatar
Min RK committed
19 20
	include/zmq.h \
	include/zmq_utils.h
21

22
src_libzmq_la_SOURCES = \
23 24 25 26 27 28
	src/address.cpp \
	src/address.hpp \
	src/array.hpp \
	src/atomic_counter.hpp \
	src/atomic_ptr.hpp \
	src/blob.hpp \
29 30
	src/client.cpp \
	src/client.hpp \
31 32 33
	src/clock.cpp \
	src/clock.hpp \
	src/command.hpp \
somdoron's avatar
somdoron committed
34
	src/condition_variable.hpp \
35 36 37 38 39
	src/config.hpp \
	src/ctx.cpp \
	src/ctx.hpp \
	src/curve_client.cpp \
	src/curve_client.hpp \
40
	src/curve_client_tools.hpp \
41 42
	src/curve_mechanism_base.cpp \
	src/curve_mechanism_base.hpp \
43 44 45 46 47 48 49 50
	src/curve_server.cpp \
	src/curve_server.hpp \
	src/dbuffer.hpp \
	src/dealer.cpp \
	src/dealer.hpp \
	src/decoder.hpp \
	src/devpoll.cpp \
	src/devpoll.hpp \
51 52
	src/dgram.cpp \
	src/dgram.hpp \
somdoron's avatar
somdoron committed
53 54
	src/dish.cpp \
	src/dish.hpp \
55 56 57
	src/dist.cpp \
	src/dist.hpp \
	src/encoder.hpp \
58 59
	src/endpoint.hpp \
	src/endpoint.cpp \
60 61 62 63 64 65 66
	src/epoll.cpp \
	src/epoll.hpp \
	src/err.cpp \
	src/err.hpp \
	src/fd.hpp \
	src/fq.cpp \
	src/fq.hpp \
somdoron's avatar
somdoron committed
67 68
	src/gather.cpp \
	src/gather.hpp \
69 70
	src/generic_mtrie.hpp \
	src/generic_mtrie_impl.hpp \
71 72 73 74 75 76 77 78 79
	src/gssapi_mechanism_base.cpp \
	src/gssapi_mechanism_base.hpp \
	src/gssapi_client.cpp \
	src/gssapi_client.hpp \
	src/gssapi_server.cpp \
	src/gssapi_server.hpp \
	src/i_encoder.hpp \
	src/i_engine.hpp \
	src/i_decoder.hpp \
somdoron's avatar
somdoron committed
80
	src/i_mailbox.hpp \
81 82 83 84 85 86 87
	src/i_poll_events.hpp \
	src/io_object.cpp \
	src/io_object.hpp \
	src/io_thread.cpp \
	src/io_thread.hpp \
	src/ip.cpp \
	src/ip.hpp \
88 89
	src/ip_resolver.cpp \
	src/ip_resolver.hpp \
90 91 92 93 94 95 96 97 98 99 100
	src/ipc_address.cpp \
	src/ipc_address.hpp \
	src/ipc_connecter.cpp \
	src/ipc_connecter.hpp \
	src/ipc_listener.cpp \
	src/ipc_listener.hpp \
	src/kqueue.cpp \
	src/kqueue.hpp \
	src/lb.cpp \
	src/lb.hpp \
	src/likely.hpp \
101
	src/macros.hpp \
102 103
	src/mailbox.cpp \
	src/mailbox.hpp \
somdoron's avatar
somdoron committed
104 105
	src/mailbox_safe.cpp \
	src/mailbox_safe.hpp \
106 107
	src/mechanism.cpp \
	src/mechanism.hpp  \
108 109
	src/mechanism_base.cpp \
	src/mechanism_base.hpp  \
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
	src/metadata.cpp \
	src/metadata.hpp \
	src/msg.cpp \
	src/msg.hpp \
	src/mtrie.cpp \
	src/mtrie.hpp \
	src/mutex.hpp \
	src/norm_engine.cpp \
	src/norm_engine.hpp \
	src/null_mechanism.cpp \
	src/null_mechanism.hpp \
	src/object.cpp \
	src/object.hpp \
	src/options.cpp \
	src/options.hpp \
	src/own.cpp \
	src/own.hpp \
	src/pair.cpp \
	src/pair.hpp \
	src/pgm_receiver.cpp \
	src/pgm_receiver.hpp \
	src/pgm_sender.cpp \
	src/pgm_sender.hpp \
	src/pgm_socket.cpp \
	src/pgm_socket.hpp \
	src/pipe.cpp \
	src/pipe.hpp \
	src/plain_client.cpp \
	src/plain_client.hpp \
139
	src/plain_common.hpp \
140 141 142 143 144 145 146 147
	src/plain_server.cpp \
	src/plain_server.hpp \
	src/platform.hpp \
	src/poll.cpp \
	src/poll.hpp \
	src/poller.hpp \
	src/poller_base.cpp \
	src/poller_base.hpp \
148 149
	src/polling_util.cpp \
	src/polling_util.hpp \
Laughing's avatar
Laughing committed
150 151
	src/pollset.cpp \
	src/pollset.hpp \
152 153
	src/precompiled.cpp \
	src/precompiled.hpp \
154 155 156 157 158 159 160 161
	src/proxy.cpp \
	src/proxy.hpp \
	src/pub.cpp \
	src/pub.hpp \
	src/pull.cpp \
	src/pull.hpp \
	src/push.cpp \
	src/push.hpp \
somdoron's avatar
somdoron committed
162 163
	src/radio.cpp \
	src/radio.hpp \
164 165
	src/radix_tree.cpp \
	src/radix_tree.hpp \
166 167 168 169 170 171
	src/random.cpp \
	src/random.hpp \
	src/raw_decoder.cpp \
	src/raw_decoder.hpp \
	src/raw_encoder.cpp \
	src/raw_encoder.hpp \
172 173
	src/raw_engine.cpp \
	src/raw_engine.hpp \
174 175 176 177 178 179 180 181
	src/reaper.cpp \
	src/reaper.hpp \
	src/rep.cpp \
	src/rep.hpp \
	src/req.cpp \
	src/req.hpp \
	src/router.cpp \
	src/router.hpp \
somdoron's avatar
somdoron committed
182 183
	src/scatter.cpp \
	src/scatter.hpp \
184
	src/secure_allocator.hpp \
185 186
	src/select.cpp \
	src/select.hpp \
187 188
	src/server.cpp \
	src/server.hpp \
189 190 191 192 193 194 195 196 197 198 199 200 201
	src/session_base.cpp \
	src/session_base.hpp \
	src/signaler.cpp \
	src/signaler.hpp \
	src/socket_base.cpp \
	src/socket_base.hpp \
	src/socks.cpp \
	src/socks.hpp \
	src/socks_connecter.cpp \
	src/socks_connecter.hpp \
	src/stdint.hpp \
	src/stream.cpp \
	src/stream.hpp \
202 203
	src/stream_connecter_base.cpp \
	src/stream_connecter_base.hpp \
204 205
	src/stream_listener_base.cpp \
	src/stream_listener_base.hpp \
206 207
	src/stream_engine_base.cpp \
	src/stream_engine_base.hpp \
208 209 210 211 212 213 214 215 216 217 218 219
	src/sub.cpp \
	src/sub.hpp \
	src/tcp.cpp \
	src/tcp.hpp \
	src/tcp_address.cpp \
	src/tcp_address.hpp \
	src/tcp_connecter.cpp \
	src/tcp_connecter.hpp \
	src/tcp_listener.cpp \
	src/tcp_listener.hpp \
	src/thread.cpp \
	src/thread.hpp \
somdoron's avatar
somdoron committed
220 221
	src/timers.cpp \
	src/timers.hpp \
222 223 224 225 226 227 228 229
	src/tipc_address.cpp \
	src/tipc_address.hpp \
	src/tipc_connecter.cpp \
	src/tipc_connecter.hpp \
	src/tipc_listener.cpp \
	src/tipc_listener.hpp \
	src/trie.cpp \
	src/trie.hpp \
230 231 232 233
	src/udp_address.cpp \
	src/udp_address.hpp \
	src/udp_engine.cpp \
	src/udp_engine.hpp \
234 235 236 237 238 239 240 241 242
	src/v1_decoder.cpp \
	src/v1_decoder.hpp \
	src/v2_decoder.cpp \
	src/v2_decoder.hpp \
	src/v1_encoder.cpp \
	src/v1_encoder.hpp \
	src/v2_encoder.cpp \
	src/v2_encoder.hpp \
	src/v2_protocol.hpp \
Ilya Kulakov's avatar
Ilya Kulakov committed
243 244 245 246 247 248 249 250
	src/vmci.cpp \
	src/vmci.hpp \
	src/vmci_address.cpp \
	src/vmci_address.hpp \
	src/vmci_connecter.cpp \
	src/vmci_connecter.hpp \
	src/vmci_listener.cpp \
	src/vmci_listener.hpp \
251 252
	src/windows.hpp \
	src/wire.hpp \
253 254 255 256 257 258 259 260 261 262 263
	src/ws_connecter.cpp \
	src/ws_connecter.hpp \
	src/ws_decoder.cpp \
	src/ws_decoder.hpp \
	src/ws_encoder.cpp \
	src/ws_encoder.hpp \
	src/ws_engine.cpp \
	src/ws_engine.hpp \
	src/ws_listener.cpp \
	src/ws_listener.hpp \
	src/ws_protocol.hpp \
264
	src/xpub.cpp \
265
	src/xpub.hpp \
266 267 268 269 270 271 272
	src/xsub.cpp \
	src/xsub.hpp \
	src/ypipe.hpp \
	src/ypipe_base.hpp \
	src/ypipe_conflate.hpp \
	src/yqueue.hpp \
	src/zmq.cpp \
Jens Auer's avatar
Jens Auer committed
273
	src/zmq_utils.cpp \
274 275 276
	src/decoder_allocators.cpp \
	src/decoder_allocators.hpp \
	src/socket_poller.cpp \
277
	src/socket_poller.hpp \
278 279
	src/zap_client.cpp \
	src/zap_client.hpp \
280 281
	src/zmtp_engine.cpp \
	src/zmtp_engine.hpp \
282 283 284
	src/zmq_draft.h \
	external/sha1/sha1.c \
	external/sha1/sha1.h
Jens Auer's avatar
Jens Auer committed
285

286 287
if USE_WEPOLL
src_libzmq_la_SOURCES += \
288 289
	external/wepoll/wepoll.c \
	external/wepoll/wepoll.h
290 291
endif

292 293 294 295 296 297
if USE_TWEETNACL
src_libzmq_la_SOURCES += \
	src/tweetnacl.c \
	src/tweetnacl.h
endif

298
if ON_MINGW
299
src_libzmq_la_LDFLAGS = \
300 301 302 303 304
	-no-undefined \
	-avoid-version \
	-version-info @LTVER@ \
	@LIBZMQ_EXTRA_LDFLAGS@
else
305 306 307 308 309 310 311
if ON_CYGWIN
src_libzmq_la_LDFLAGS = \
	-no-undefined \
	-avoid-version \
	-version-info @LTVER@ \
	@LIBZMQ_EXTRA_LDFLAGS@
else
312
if ON_ANDROID
313
src_libzmq_la_LDFLAGS = \
314 315 316
	-avoid-version \
	-version-info @LTVER@ \
	@LIBZMQ_EXTRA_LDFLAGS@
317
else
318
src_libzmq_la_LDFLAGS = \
319
	-version-info @LTVER@ \
320
	@LIBZMQ_EXTRA_LDFLAGS@
321
endif
322
endif
323
endif
324

325 326 327
if HAVE_VSCRIPT_COMPLEX
src_libzmq_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(srcdir)/src/libzmq.vers
endif
328

329 330 331 332 333
src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS)
src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS)
src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS) \
	$(LIBUNWIND_CFLAGS)
src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS)
334

335 336 337 338 339
if USE_LIBSODIUM
src_libzmq_la_CPPFLAGS += ${sodium_CFLAGS}
src_libzmq_la_LIBADD += ${sodium_LIBS}
endif

340
if HAVE_PGM
341 342
src_libzmq_la_CPPFLAGS += ${pgm_CFLAGS}
src_libzmq_la_LIBADD += ${pgm_LIBS}
343 344
endif

345 346 347 348 349
if HAVE_NORM
src_libzmq_la_CPPFLAGS += ${norm_CFLAGS}
src_libzmq_la_LIBADD += ${norm_LIBS}
endif

350 351 352 353 354
if BUILD_GSSAPI
src_libzmq_la_CPPFLAGS += ${gssapi_krb5_CFLAGS}
src_libzmq_la_LIBADD += ${gssapi_krb5_LIBS}
endif

355
if ENABLE_PERF
356
noinst_PROGRAMS = \
357 358 359 360 361
	perf/local_lat \
	perf/remote_lat \
	perf/local_thr \
	perf/remote_thr \
	perf/inproc_lat \
362 363
	perf/inproc_thr \
	perf/proxy_thr
364

365 366
perf_local_lat_LDADD = src/libzmq.la
perf_local_lat_SOURCES = perf/local_lat.cpp
367

368 369
perf_remote_lat_LDADD = src/libzmq.la
perf_remote_lat_SOURCES = perf/remote_lat.cpp
370

371 372
perf_local_thr_LDADD = src/libzmq.la
perf_local_thr_SOURCES = perf/local_thr.cpp
373

374 375
perf_remote_thr_LDADD = src/libzmq.la
perf_remote_thr_SOURCES = perf/remote_thr.cpp
376

377 378
perf_inproc_lat_LDADD = src/libzmq.la
perf_inproc_lat_SOURCES = perf/inproc_lat.cpp
379

380 381
perf_inproc_thr_LDADD = src/libzmq.la
perf_inproc_thr_SOURCES = perf/inproc_thr.cpp
382

383 384 385
perf_proxy_thr_LDADD = src/libzmq.la
perf_proxy_thr_SOURCES = perf/proxy_thr.cpp

386 387 388 389 390 391 392 393 394 395
if ENABLE_STATIC
noinst_PROGRAMS += \
	perf/benchmark_radix_tree

perf_benchmark_radix_tree_DEPENDENCIES = src/libzmq.la
perf_benchmark_radix_tree_CPPFLAGS = -I$(top_srcdir)/src
perf_benchmark_radix_tree_LDADD = $(top_builddir)/src/.libs/libzmq.a \
	${src_libzmq_la_LIBADD}
perf_benchmark_radix_tree_SOURCES = perf/benchmark_radix_tree.cpp
endif
396
endif
397

398
if ENABLE_CURVE_KEYGEN
399
bin_PROGRAMS = tools/curve_keygen
400

401 402
tools_curve_keygen_LDADD = src/libzmq.la
tools_curve_keygen_SOURCES = tools/curve_keygen.cpp
403
endif
404

405 406 407
#
# tests
#
408
test_apps = \
409
	tests/test_ancillaries \
410 411 412 413 414 415 416 417 418 419 420
	tests/test_system \
	tests/test_pair_inproc \
	tests/test_pair_tcp \
	tests/test_reqrep_inproc \
	tests/test_reqrep_tcp \
	tests/test_hwm \
	tests/test_hwm_pubsub \
	tests/test_reqrep_device \
	tests/test_sub_forward \
	tests/test_invalid_rep \
	tests/test_msg_flags \
421
	tests/test_msg_ffn \
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
	tests/test_connect_resolve \
	tests/test_immediate \
	tests/test_last_endpoint \
	tests/test_term_endpoint \
	tests/test_srcfd \
	tests/test_monitor \
	tests/test_router_mandatory \
	tests/test_router_mandatory_hwm \
	tests/test_router_handover \
	tests/test_probe_router \
	tests/test_stream \
	tests/test_stream_empty \
	tests/test_stream_disconnect \
	tests/test_stream_timeout \
	tests/test_disconnect_inproc \
Dylan Cali's avatar
Dylan Cali committed
437
	tests/test_unbind_wildcard \
438 439
	tests/test_ctx_options \
	tests/test_ctx_destroy \
440 441
        tests/test_security_no_zap_handler \
        tests/test_security_null \
442
	tests/test_security_plain \
443
	tests/test_security_zap \
444 445 446 447 448 449 450 451 452 453 454 455
	tests/test_iov \
	tests/test_spec_req \
	tests/test_spec_rep \
	tests/test_spec_dealer \
	tests/test_spec_router \
	tests/test_spec_pushpull \
	tests/test_req_correlate \
	tests/test_req_relaxed \
	tests/test_conflate \
	tests/test_inproc_connect \
	tests/test_issue_566 \
	tests/test_proxy \
456
	tests/test_proxy_hwm \
457
	tests/test_proxy_single_socket \
458
	tests/test_proxy_terminate \
459
	tests/test_getsockopt_memset \
460
	tests/test_setsockopt \
461 462 463 464 465
	tests/test_diffserv \
	tests/test_connect_rid \
	tests/test_bind_src_address \
	tests/test_metadata \
	tests/test_capabilities \
466
	tests/test_xpub_nodrop \
somdoron's avatar
somdoron committed
467
	tests/test_xpub_manual \
468
	tests/test_xpub_welcome_msg \
469
	tests/test_xpub_verbose \
470
	tests/test_atomics \
471
	tests/test_sockopt_hwm \
472
	tests/test_heartbeats \
473
	tests/test_stream_exceeds_buffer \
474 475
	tests/test_pub_invert_matching \
	tests/test_base85 \
476
	tests/test_bind_after_connect_tcp \
477
	tests/test_sodium \
478
	tests/test_reconnect_ivl \
479
	tests/test_mock_pub_sub \
480 481
	tests/test_socket_null \
	tests/test_ws_transport
482

483
UNITY_CPPFLAGS = -I$(top_srcdir)/external/unity -DUNITY_USE_COMMAND_LINE_ARGS -DUNITY_EXCLUDE_FLOAT
484
UNITY_LIBS = $(top_builddir)/external/unity/libunity.a
485 486 487
external_unity_libunity_a_SOURCES = external/unity/unity.c \
	external/unity/unity.h \
	external/unity/unity_internals.h
488

489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
TESTUTIL_CPPFLAGS = ${UNITY_CPPFLAGS}
TESTUTIL_LIBS = $(top_builddir)/tests/libtestutil.a ${UNITY_LIBS}
tests_libtestutil_a_SOURCES = \
        tests/testutil.cpp \
        tests/testutil.hpp \
        tests/testutil_monitoring.cpp \
        tests/testutil_monitoring.hpp \
        tests/testutil_security.cpp \
        tests/testutil_security.hpp \
        tests/testutil_unity.cpp \
        tests/testutil_unity.hpp
tests_libtestutil_a_CPPFLAGS = ${UNITY_CPPFLAGS}

noinst_LIBRARIES = external/unity/libunity.a tests/libtestutil.a

504
tests_test_ancillaries_SOURCES = tests/test_ancillaries.cpp
505 506
tests_test_ancillaries_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_ancillaries_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
507

508
tests_test_system_SOURCES = tests/test_system.cpp
509 510
tests_test_system_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_system_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
511

512
tests_test_pair_inproc_SOURCES = tests/test_pair_inproc.cpp
513 514
tests_test_pair_inproc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_pair_inproc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
515

516
tests_test_pair_tcp_SOURCES = tests/test_pair_tcp.cpp
517 518
tests_test_pair_tcp_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_pair_tcp_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
519

520
tests_test_reqrep_inproc_SOURCES = tests/test_reqrep_inproc.cpp
521 522
tests_test_reqrep_inproc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reqrep_inproc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
523

524
tests_test_reqrep_tcp_SOURCES = tests/test_reqrep_tcp.cpp
525 526
tests_test_reqrep_tcp_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reqrep_tcp_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
527

528
tests_test_hwm_SOURCES = tests/test_hwm.cpp
529 530
tests_test_hwm_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_hwm_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
531

532
tests_test_hwm_pubsub_SOURCES = tests/test_hwm_pubsub.cpp
533 534
tests_test_hwm_pubsub_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_hwm_pubsub_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
535

536
tests_test_reqrep_device_SOURCES = tests/test_reqrep_device.cpp
537 538
tests_test_reqrep_device_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reqrep_device_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
539

540
tests_test_sub_forward_SOURCES = tests/test_sub_forward.cpp
541 542
tests_test_sub_forward_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_sub_forward_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
543

544
tests_test_invalid_rep_SOURCES = tests/test_invalid_rep.cpp
545 546
tests_test_invalid_rep_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_invalid_rep_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
547

548
tests_test_msg_flags_SOURCES = tests/test_msg_flags.cpp
549 550
tests_test_msg_flags_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_msg_flags_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
551

552
tests_test_msg_ffn_SOURCES = tests/test_msg_ffn.cpp
553 554
tests_test_msg_ffn_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_msg_ffn_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
555

556
tests_test_connect_resolve_SOURCES = tests/test_connect_resolve.cpp
557 558
tests_test_connect_resolve_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_connect_resolve_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
559

560
tests_test_immediate_SOURCES = tests/test_immediate.cpp
561 562
tests_test_immediate_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_immediate_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
563

564
tests_test_last_endpoint_SOURCES = tests/test_last_endpoint.cpp
565 566
tests_test_last_endpoint_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_last_endpoint_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
567

568
tests_test_term_endpoint_SOURCES = tests/test_term_endpoint.cpp
569 570
tests_test_term_endpoint_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_term_endpoint_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
571

572
tests_test_srcfd_SOURCES = tests/test_srcfd.cpp
573 574
tests_test_srcfd_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_srcfd_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
575

576
tests_test_monitor_SOURCES = tests/test_monitor.cpp
577 578
tests_test_monitor_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_monitor_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
579

580
tests_test_router_mandatory_SOURCES = tests/test_router_mandatory.cpp
581 582
tests_test_router_mandatory_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_router_mandatory_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
583

584
tests_test_router_mandatory_hwm_SOURCES = tests/test_router_mandatory_hwm.cpp
585 586
tests_test_router_mandatory_hwm_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_router_mandatory_hwm_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
587

588
tests_test_router_handover_SOURCES = tests/test_router_handover.cpp
589 590
tests_test_router_handover_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_router_handover_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
591

592
tests_test_probe_router_SOURCES = tests/test_probe_router.cpp
593 594
tests_test_probe_router_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_probe_router_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
595

596
tests_test_stream_SOURCES = tests/test_stream.cpp
597 598
tests_test_stream_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_stream_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
599

600
tests_test_stream_empty_SOURCES = tests/test_stream_empty.cpp
601 602
tests_test_stream_empty_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_stream_empty_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
603

604
tests_test_stream_timeout_SOURCES = tests/test_stream_timeout.cpp
605 606
tests_test_stream_timeout_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_stream_timeout_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
607

608
tests_test_stream_disconnect_SOURCES = tests/test_stream_disconnect.cpp
609 610
tests_test_stream_disconnect_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_stream_disconnect_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
611

612
tests_test_disconnect_inproc_SOURCES = tests/test_disconnect_inproc.cpp
613 614
tests_test_disconnect_inproc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_disconnect_inproc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
615

Dylan Cali's avatar
Dylan Cali committed
616
tests_test_unbind_wildcard_SOURCES = tests/test_unbind_wildcard.cpp
617 618
tests_test_unbind_wildcard_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_unbind_wildcard_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
Dylan Cali's avatar
Dylan Cali committed
619

620
tests_test_ctx_options_SOURCES = tests/test_ctx_options.cpp
621 622
tests_test_ctx_options_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_ctx_options_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
623

624
tests_test_iov_SOURCES = tests/test_iov.cpp
625 626
tests_test_iov_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_iov_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
627

628
tests_test_ctx_destroy_SOURCES = tests/test_ctx_destroy.cpp
629 630
tests_test_ctx_destroy_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_ctx_destroy_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
631

632
tests_test_security_no_zap_handler_SOURCES = tests/test_security_no_zap_handler.cpp
633 634
tests_test_security_no_zap_handler_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_security_no_zap_handler_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
635

636
tests_test_security_null_SOURCES = tests/test_security_null.cpp
637 638
tests_test_security_null_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_security_null_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
639

640
tests_test_security_plain_SOURCES = tests/test_security_plain.cpp
641 642
tests_test_security_plain_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_security_plain_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
643

644
tests_test_security_zap_SOURCES = tests/test_security_zap.cpp
645 646
tests_test_security_zap_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_security_zap_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
647

648
tests_test_spec_req_SOURCES = tests/test_spec_req.cpp
649 650
tests_test_spec_req_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_spec_req_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
651

652
tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp
653 654
tests_test_spec_rep_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_spec_rep_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
655

656
tests_test_spec_dealer_SOURCES = tests/test_spec_dealer.cpp
657 658
tests_test_spec_dealer_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_spec_dealer_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
659

660
tests_test_spec_router_SOURCES = tests/test_spec_router.cpp
661 662
tests_test_spec_router_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_spec_router_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
663

664
tests_test_spec_pushpull_SOURCES = tests/test_spec_pushpull.cpp
665 666
tests_test_spec_pushpull_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_spec_pushpull_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
667

668
tests_test_req_correlate_SOURCES = tests/test_req_correlate.cpp
669 670
tests_test_req_correlate_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_req_correlate_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
671

672
tests_test_req_relaxed_SOURCES = tests/test_req_relaxed.cpp
673 674
tests_test_req_relaxed_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_req_relaxed_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
675

676
tests_test_conflate_SOURCES = tests/test_conflate.cpp
677 678
tests_test_conflate_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_conflate_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
679

680
tests_test_inproc_connect_SOURCES = tests/test_inproc_connect.cpp
681 682
tests_test_inproc_connect_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_inproc_connect_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
683

684
tests_test_issue_566_SOURCES = tests/test_issue_566.cpp
685 686
tests_test_issue_566_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_issue_566_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
687

688
tests_test_proxy_SOURCES = tests/test_proxy.cpp
689 690
tests_test_proxy_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_proxy_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
691

692
tests_test_proxy_hwm_SOURCES = tests/test_proxy_hwm.cpp
693 694
tests_test_proxy_hwm_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_proxy_hwm_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
695

696
tests_test_proxy_single_socket_SOURCES = tests/test_proxy_single_socket.cpp
697 698
tests_test_proxy_single_socket_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_proxy_single_socket_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
699

700
tests_test_proxy_terminate_SOURCES = tests/test_proxy_terminate.cpp
701 702
tests_test_proxy_terminate_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_proxy_terminate_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
703

704
tests_test_getsockopt_memset_SOURCES = tests/test_getsockopt_memset.cpp
705 706
tests_test_getsockopt_memset_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_getsockopt_memset_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
707

708
tests_test_many_sockets_SOURCES = tests/test_many_sockets.cpp
709 710
tests_test_many_sockets_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_many_sockets_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
711

712
tests_test_diffserv_SOURCES = tests/test_diffserv.cpp
713 714
tests_test_diffserv_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_diffserv_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
715

716
tests_test_connect_rid_SOURCES = tests/test_connect_rid.cpp
717 718
tests_test_connect_rid_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_connect_rid_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
719

720
tests_test_bind_src_address_SOURCES = tests/test_bind_src_address.cpp
721 722
tests_test_bind_src_address_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_bind_src_address_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
723

724
tests_test_metadata_SOURCES = tests/test_metadata.cpp
725 726
tests_test_metadata_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_metadata_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
727

728
tests_test_capabilities_SOURCES = tests/test_capabilities.cpp
729 730
tests_test_capabilities_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_capabilities_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
731

732
tests_test_xpub_nodrop_SOURCES = tests/test_xpub_nodrop.cpp
733 734
tests_test_xpub_nodrop_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_xpub_nodrop_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
735

736
tests_test_xpub_manual_SOURCES = tests/test_xpub_manual.cpp
737 738
tests_test_xpub_manual_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_xpub_manual_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
739

somdoron's avatar
somdoron committed
740
tests_test_xpub_welcome_msg_SOURCES = tests/test_xpub_welcome_msg.cpp
741 742
tests_test_xpub_welcome_msg_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_xpub_welcome_msg_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
somdoron's avatar
somdoron committed
743

744
tests_test_xpub_verbose_SOURCES = tests/test_xpub_verbose.cpp
745 746
tests_test_xpub_verbose_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_xpub_verbose_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
747

748
tests_test_atomics_SOURCES = tests/test_atomics.cpp
749 750
tests_test_atomics_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_atomics_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
751

752
tests_test_sockopt_hwm_SOURCES = tests/test_sockopt_hwm.cpp
753 754
tests_test_sockopt_hwm_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_sockopt_hwm_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
755

756
tests_test_setsockopt_SOURCES = tests/test_setsockopt.cpp
757 758
tests_test_setsockopt_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_setsockopt_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
759

Jonathan Reams's avatar
Jonathan Reams committed
760
tests_test_heartbeats_SOURCES = tests/test_heartbeats.cpp
761 762
tests_test_heartbeats_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_heartbeats_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
somdoron's avatar
somdoron committed
763

764
tests_test_stream_exceeds_buffer_SOURCES = tests/test_stream_exceeds_buffer.cpp
765 766
tests_test_stream_exceeds_buffer_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_stream_exceeds_buffer_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
767

768
tests_test_pub_invert_matching_SOURCES = tests/test_pub_invert_matching.cpp
769 770
tests_test_pub_invert_matching_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_pub_invert_matching_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
771

772
tests_test_bind_after_connect_tcp_SOURCES = tests/test_bind_after_connect_tcp.cpp
773 774
tests_test_bind_after_connect_tcp_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_bind_after_connect_tcp_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
775

776
tests_test_base85_SOURCES = tests/test_base85.cpp
777 778
tests_test_base85_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_base85_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
779 780

tests_test_sodium_SOURCES = tests/test_sodium.cpp
781 782
tests_test_sodium_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_sodium_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
783

784
tests_test_socket_null_SOURCES = tests/test_socket_null.cpp
785 786
tests_test_socket_null_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_socket_null_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
787

788
tests_test_reconnect_ivl_SOURCES = tests/test_reconnect_ivl.cpp
789 790
tests_test_reconnect_ivl_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reconnect_ivl_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
791

792
tests_test_mock_pub_sub_SOURCES = tests/test_mock_pub_sub.cpp
793 794
tests_test_mock_pub_sub_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_mock_pub_sub_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
795

796 797 798 799
tests_test_ws_transport_SOURCES = tests/test_ws_transport.cpp
tests_test_ws_transport_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_ws_transport_CPPFLAGS = ${TESTUTIL_CPPFLAGS}

800 801 802 803 804 805 806
if HAVE_CURVE

test_apps += \
	tests/test_security_curve

tests_test_security_curve_SOURCES = \
	tests/test_security_curve.cpp \
807
        src/curve_client_tools.hpp \
808 809 810 811 812 813 814 815 816 817 818 819 820
	src/clock.hpp \
	src/clock.cpp \
	src/random.hpp \
	src/random.cpp \
	src/err.hpp \
	src/err.cpp

if USE_TWEETNACL
tests_test_security_curve_SOURCES += \
	src/tweetnacl.c
endif

tests_test_security_curve_LDADD = \
821
        src/libzmq.la ${TESTUTIL_LIBS} $(LIBUNWIND_LIBS)
822
tests_test_security_curve_CPPFLAGS = \
823
        ${TESTUTIL_CPPFLAGS} \
824
	${LIBUNWIND_CFLAGS}
825 826

if USE_LIBSODIUM
827 828
tests_test_security_curve_CPPFLAGS += \
	${sodium_CFLAGS}
829 830 831 832 833 834
tests_test_security_curve_LDADD += \
	${sodium_LIBS}
endif

endif

835
if !ON_MINGW
836
if !ON_CYGWIN
837
test_apps += \
838
	tests/test_shutdown_stress \
839
	tests/test_ipc_wildcard \
840
	tests/test_pair_ipc \
841
	tests/test_rebind_ipc \
842
	tests/test_reqrep_ipc \
843
	tests/test_use_fd \
844
	tests/test_zmq_poll_fd \
845 846
	tests/test_timeo \
	tests/test_filter_ipc
847

848
tests_test_shutdown_stress_SOURCES = tests/test_shutdown_stress.cpp
849 850
tests_test_shutdown_stress_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_shutdown_stress_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
851

852
tests_test_ipc_wildcard_SOURCES = tests/test_ipc_wildcard.cpp
853 854
tests_test_ipc_wildcard_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_ipc_wildcard_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
855

856
tests_test_pair_ipc_SOURCES = tests/test_pair_ipc.cpp
857 858
tests_test_pair_ipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_pair_ipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
859

860
tests_test_rebind_ipc_SOURCES = tests/test_rebind_ipc.cpp
861 862
tests_test_rebind_ipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_rebind_ipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
863

864
tests_test_reqrep_ipc_SOURCES = tests/test_reqrep_ipc.cpp
865 866
tests_test_reqrep_ipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reqrep_ipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
867

868
tests_test_timeo_SOURCES = tests/test_timeo.cpp
869 870
tests_test_timeo_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_timeo_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
871

872
tests_test_filter_ipc_SOURCES = tests/test_filter_ipc.cpp
873 874
tests_test_filter_ipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_filter_ipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
875

876
tests_test_use_fd_SOURCES = tests/test_use_fd.cpp
877 878
tests_test_use_fd_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_use_fd_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
879

880
tests_test_zmq_poll_fd_SOURCES = tests/test_zmq_poll_fd.cpp
881 882
tests_test_zmq_poll_fd_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_zmq_poll_fd_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
883

884
if HAVE_FORK
885
if !VALGRIND_ENABLED
886
test_apps += tests/test_fork
887

888
tests_test_fork_SOURCES = tests/test_fork.cpp
889 890
tests_test_fork_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_fork_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
891

892
endif
893
endif
894 895 896 897 898
endif
endif

if BUILD_TIPC
test_apps += \
899 900 901 902 903 904 905
	tests/test_connect_delay_tipc \
	tests/test_pair_tipc \
	tests/test_reqrep_device_tipc \
	tests/test_reqrep_tipc \
	tests/test_router_mandatory_tipc \
	tests/test_shutdown_stress_tipc \
	tests/test_sub_forward_tipc \
906 907
	tests/test_term_endpoint_tipc \
	tests/test_address_tipc
908

909
tests_test_connect_delay_tipc_SOURCES = tests/test_connect_delay_tipc.cpp
910 911
tests_test_connect_delay_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_connect_delay_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
912

913
tests_test_pair_tipc_SOURCES = tests/test_pair_tipc.cpp
914 915
tests_test_pair_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_pair_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
916

917
tests_test_reqrep_device_tipc_SOURCES = tests/test_reqrep_device_tipc.cpp
918 919
tests_test_reqrep_device_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reqrep_device_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
920

921
tests_test_reqrep_tipc_SOURCES = tests/test_reqrep_tipc.cpp
922 923
tests_test_reqrep_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_reqrep_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
924

925
tests_test_router_mandatory_tipc_SOURCES = tests/test_router_mandatory_tipc.cpp
926 927
tests_test_router_mandatory_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_router_mandatory_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
928

929
tests_test_shutdown_stress_tipc_SOURCES = tests/test_shutdown_stress_tipc.cpp
930 931
tests_test_shutdown_stress_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_shutdown_stress_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
932

933
tests_test_sub_forward_tipc_SOURCES = tests/test_sub_forward_tipc.cpp
934 935
tests_test_sub_forward_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_sub_forward_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
936

937
tests_test_term_endpoint_tipc_SOURCES = tests/test_term_endpoint_tipc.cpp
938 939
tests_test_term_endpoint_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_term_endpoint_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
940

941
tests_test_address_tipc_SOURCES = tests/test_address_tipc.cpp
942 943
tests_test_address_tipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_address_tipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
944

945 946
endif

947 948 949 950
if BUILD_GSSAPI
test_apps += tests/test_security_gssapi

tests_test_security_gssapi_SOURCES = tests/test_security_gssapi.cpp
951 952
tests_test_security_gssapi_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_security_gssapi_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
953 954 955

endif

956
if ON_LINUX
957
test_apps += tests/test_abstract_ipc \
958 959
	tests/test_many_sockets \
	tests/test_socks
960

961
tests_test_abstract_ipc_SOURCES = tests/test_abstract_ipc.cpp
962 963
tests_test_abstract_ipc_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_abstract_ipc_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
964

965 966 967 968
tests_test_socks_SOURCES = tests/test_socks.cpp
tests_test_socks_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_socks_CPPFLAGS = ${TESTUTIL_CPPFLAGS}

969 970
endif

Ilya Kulakov's avatar
Ilya Kulakov committed
971 972 973 974
if HAVE_VMCI
test_apps += test_pair_vmci test_reqrep_vmci

test_pair_vmci_SOURCES = tests/test_pair_vmci.cpp
975 976
test_pair_vmci_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
test_pair_vmci_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
Ilya Kulakov's avatar
Ilya Kulakov committed
977 978 979 980
test_pair_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@
test_pair_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@

test_reqrep_vmci_SOURCES = tests/test_reqrep_vmci.cpp
981 982
test_reqrep_vmci_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
test_reqrep_vmci_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
Ilya Kulakov's avatar
Ilya Kulakov committed
983 984 985 986 987
test_reqrep_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@
test_reqrep_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@

endif

988
if ENABLE_DRAFTS
989 990
test_apps += tests/test_poller \
	tests/test_client_server \
991
	tests/test_thread_safe \
992 993
	tests/test_timers \
	tests/test_radio_dish \
Bitiquinho's avatar
Bitiquinho committed
994
	tests/test_scatter_gather \
995
	tests/test_dgram \
996
	tests/test_app_meta \
997
	tests/test_xpub_manual_last_value \
998
	tests/test_router_notify
999

1000
tests_test_poller_SOURCES = tests/test_poller.cpp
1001 1002
tests_test_poller_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_poller_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1003

1004
tests_test_client_server_SOURCES = tests/test_client_server.cpp
1005 1006
tests_test_client_server_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_client_server_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1007 1008

tests_test_thread_safe_SOURCES = tests/test_thread_safe.cpp
1009 1010
tests_test_thread_safe_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_thread_safe_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1011 1012

tests_test_timers_SOURCES = tests/test_timers.cpp
1013 1014
tests_test_timers_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_timers_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1015 1016

tests_test_radio_dish_SOURCES = tests/test_radio_dish.cpp
1017 1018
tests_test_radio_dish_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_radio_dish_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1019

1020
tests_test_scatter_gather_SOURCES = tests/test_scatter_gather.cpp
1021 1022
tests_test_scatter_gather_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_scatter_gather_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
Bitiquinho's avatar
Bitiquinho committed
1023 1024

tests_test_dgram_SOURCES = tests/test_dgram.cpp
1025 1026
tests_test_dgram_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_dgram_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1027

1028 1029 1030 1031
tests_test_xpub_manual_last_value_SOURCES = tests/test_xpub_manual_last_value.cpp
tests_test_xpub_manual_last_value_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_xpub_manual_last_value_CPPFLAGS = ${TESTUTIL_CPPFLAGS}

1032
tests_test_app_meta_SOURCES = tests/test_app_meta.cpp
1033 1034
tests_test_app_meta_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_app_meta_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1035 1036

tests_test_router_notify_SOURCES = tests/test_router_notify.cpp
1037 1038
tests_test_router_notify_LDADD = src/libzmq.la ${TESTUTIL_LIBS}
tests_test_router_notify_CPPFLAGS = ${TESTUTIL_CPPFLAGS}
1039 1040
endif

1041 1042 1043 1044
if ENABLE_STATIC
# unit tests - these include individual source files and test the internal functions
test_apps += \
	unittests/unittest_poller \
1045
	unittests/unittest_ypipe \
1046
	unittests/unittest_mtrie \
1047
	unittests/unittest_ip_resolver \
1048 1049
	unittests/unittest_udp_address \
	unittests/unittest_radix_tree
1050 1051

unittests_unittest_poller_SOURCES = unittests/unittest_poller.cpp
1052
unittests_unittest_poller_CPPFLAGS = -I$(top_srcdir)/src ${TESTUTIL_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
1053
unittests_unittest_poller_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
1054 1055 1056 1057 1058
unittests_unittest_poller_LDADD = \
        ${TESTUTIL_LIBS} \
        $(top_builddir)/src/.libs/libzmq.a \
        ${src_libzmq_la_LIBADD} \
        $(CODE_COVERAGE_LDFLAGS)
1059 1060

unittests_unittest_ypipe_SOURCES = unittests/unittest_ypipe.cpp
1061
unittests_unittest_ypipe_CPPFLAGS = -I$(top_srcdir)/src ${TESTUTIL_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
1062
unittests_unittest_ypipe_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
1063 1064 1065 1066 1067
unittests_unittest_ypipe_LDADD = \
        ${TESTUTIL_LIBS} \
        $(top_builddir)/src/.libs/libzmq.a \
        ${src_libzmq_la_LIBADD} \
        $(CODE_COVERAGE_LDFLAGS)
1068 1069

unittests_unittest_mtrie_SOURCES = unittests/unittest_mtrie.cpp
1070
unittests_unittest_mtrie_CPPFLAGS = -I$(top_srcdir)/src ${TESTUTIL_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
1071
unittests_unittest_mtrie_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
1072 1073 1074 1075 1076
unittests_unittest_mtrie_LDADD = \
        ${TESTUTIL_LIBS} \
        $(top_builddir)/src/.libs/libzmq.a \
        ${src_libzmq_la_LIBADD} \
        $(CODE_COVERAGE_LDFLAGS)
1077

1078
unittests_unittest_ip_resolver_SOURCES = unittests/unittest_ip_resolver.cpp unittests/unittest_resolver_common.hpp
1079
unittests_unittest_ip_resolver_CPPFLAGS = -I$(top_srcdir)/src ${TESTUTIL_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
1080
unittests_unittest_ip_resolver_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
1081 1082 1083 1084 1085
unittests_unittest_ip_resolver_LDADD = \
        ${TESTUTIL_LIBS} \
        $(top_builddir)/src/.libs/libzmq.a \
        ${src_libzmq_la_LIBADD} \
        $(CODE_COVERAGE_LDFLAGS)
1086

1087
unittests_unittest_udp_address_SOURCES = unittests/unittest_udp_address.cpp unittests/unittest_resolver_common.hpp
1088
unittests_unittest_udp_address_CPPFLAGS = -I$(top_srcdir)/src ${TESTUTIL_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
1089
unittests_unittest_udp_address_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
1090 1091 1092 1093 1094
unittests_unittest_udp_address_LDADD = \
        ${TESTUTIL_LIBS} \
        $(top_builddir)/src/.libs/libzmq.a \
        ${src_libzmq_la_LIBADD} \
        $(CODE_COVERAGE_LDFLAGS)
1095 1096

unittests_unittest_radix_tree_SOURCES = unittests/unittest_radix_tree.cpp
1097
unittests_unittest_radix_tree_CPPFLAGS = -I$(top_srcdir)/src ${TESTUTIL_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
1098
unittests_unittest_radix_tree_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
1099 1100 1101 1102 1103
unittests_unittest_radix_tree_LDADD =  \
        ${TESTUTIL_LIBS} \
        $(top_builddir)/src/.libs/libzmq.a \
        ${src_libzmq_la_LIBADD} \
        $(CODE_COVERAGE_LDFLAGS)
1104 1105
endif

1106 1107 1108 1109
check_PROGRAMS = ${test_apps}

#  Run the test cases
TESTS = $(test_apps)
1110
XFAIL_TESTS =
1111 1112

if !ON_LINUX
1113
XFAIL_TESTS += tests/test_abstract_ipc
1114
endif
1115

1116 1117
#  GNU/Hurd does not support getsockname on IPC, so ZMQ_LAST_ENDPOINT cannot be
#  used with IPC, so the following tests will fail
1118
if ON_GNU
1119
XFAIL_TESTS += tests/test_ipc_wildcard \
1120
		tests/test_reqrep_ipc \
1121
		tests/test_pair_ipc \
1122
		tests/test_rebind_ipc \
1123
		tests/test_term_endpoint
1124 1125
endif

1126
EXTRA_DIST = \
1127 1128
	external/unity/license.txt \
	external/unity/version.txt \
1129 1130 1131
	external/wepoll/license.txt \
	external/wepoll/version.txt \
	external/wepoll/README.md \
1132
	CMakeLists.txt \
1133 1134
	autogen.sh	\
	version.sh	\
1135
	ci_build.sh \
1136
	src/libzmq.vers \
1137 1138
	src/version.rc.in \
	tests/CMakeLists.txt \
1139
        tests/test_pair_tcp_cap_net_admin.cpp \
1140
	unittests/CMakeLists.txt \
1141
        tools/curve_keygen.cpp
1142

1143
MAINTAINERCLEANFILES = \
1144 1145 1146
	$(srcdir)/aclocal.m4 \
	$(srcdir)/autom4te.cache \
	$(srcdir)/configure \
1147
	`find "$(srcdir)" -type f -name Makefile.in -print`
malosek's avatar
malosek committed
1148

1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199
if WITH_CLANG_FORMAT
ALL_SOURCE_FILES = $(wildcard \
	$(top_srcdir)/src/*.c \
	$(top_srcdir)/src/*.cc \
	$(top_srcdir)/src/*.cpp \
	$(top_srcdir)/src/*.h \
	$(top_srcdir)/src/*.hpp \
	$(top_srcdir)/tests/*.c \
	$(top_srcdir)/tests/*.cc \
	$(top_srcdir)/tests/*.cpp \
	$(top_srcdir)/tests/*.h \
	$(top_srcdir)/tests/*.hpp \
	$(top_srcdir)/perf/*.c \
	$(top_srcdir)/perf/*.cc \
	$(top_srcdir)/perf/*.cpp \
	$(top_srcdir)/perf/*.h \
	$(top_srcdir)/perf/*.hpp \
	$(top_srcdir)/tools/*.c \
	$(top_srcdir)/tools/*.cc \
	$(top_srcdir)/tools/*.cpp \
	$(top_srcdir)/tools/*.h \
	$(top_srcdir)/tools/*.hpp \
	$(top_srcdir)/include/*.h \
 )

# Check if any sources need to be fixed, report the filenames and an error code
clang-format-check: $(ALL_SOURCE_FILES)
	@FAILED=0 ; IFS=";" ; IDS="`printf '\n\b'`" ; export IFS IDS; \
	 for FILE in $(ALL_SOURCE_FILES) ; do \
		test -s $$FILE || continue ; \
		$(CLANG_FORMAT) -style=file -output-replacements-xml "$$FILE" | grep "<replacement " >/dev/null && \
		{ echo "$$FILE is not correctly formatted" >&2 ; FAILED=1; } ; \
	 done; \
	 if test "$$FAILED" != 0 ; then \
		exit 1 ; \
	 fi

# Change source formatting
clang-format: $(ALL_SOURCE_FILES)
	$(CLANG_FORMAT) -style=file -i $(ALL_SOURCE_FILES)

# Change source formatting AND report the diff
clang-format-diff: clang-format
	git diff $(ALL_SOURCE_FILES)

else
clang-format clang-format-check clang-format-diff:
	@echo "Install the clang-format program, reconfigure and re-run this request"
	@exit 1
endif

1200 1201
@CODE_COVERAGE_RULES@

1202
dist-hook:
1203
	-rm $(distdir)/src/platform.hpp
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215
	@if test -d "$(srcdir)/.git"; \
	then \
		echo Creating ChangeLog && \
		( cd "$(top_srcdir)" && \
		  echo '# Generated by Makefile. Do not edit.'; echo; \
		  $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \
		  && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
		  || ( rm -f ChangeLog.tmp ; \
		       echo Failed to generate ChangeLog >&2 ); \
	else \
		echo A git clone is required to generate a ChangeLog >&2; \
	fi
1216

1217 1218
maintainer-clean-local:
	-rm -rf $(top_srcdir)/config
1219 1220

@VALGRIND_CHECK_RULES@
1221 1222

VALGRIND_SUPPRESSIONS_FILES = builds/valgrind/valgrind.supp