• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# nghttp2 - HTTP/2 C Library
2
3# Copyright (c) 2012 Tatsuhiro Tsujikawa
4
5# Permission is hereby granted, free of charge, to any person obtaining
6# a copy of this software and associated documentation files (the
7# "Software"), to deal in the Software without restriction, including
8# without limitation the rights to use, copy, modify, merge, publish,
9# distribute, sublicense, and/or sell copies of the Software, and to
10# permit persons to whom the Software is furnished to do so, subject to
11# the following conditions:
12
13# The above copyright notice and this permission notice shall be
14# included in all copies or substantial portions of the Software.
15
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23SUBDIRS = testdata
24
25EXTRA_DIST = CMakeLists.txt munit/COPYING
26
27check_PROGRAMS = main
28
29if ENABLE_FAILMALLOC
30check_PROGRAMS += failmalloc
31endif # ENABLE_FAILMALLOC
32
33OBJECTS = main.c nghttp2_pq_test.c nghttp2_map_test.c nghttp2_queue_test.c \
34	nghttp2_test_helper.c \
35	nghttp2_frame_test.c \
36	nghttp2_stream_test.c \
37	nghttp2_session_test.c \
38	nghttp2_hd_test.c \
39	nghttp2_alpn_test.c \
40	nghttp2_helper_test.c \
41	nghttp2_buf_test.c \
42	nghttp2_http_test.c \
43	nghttp2_extpri_test.c \
44	nghttp2_ratelim_test.c \
45	munit/munit.c
46
47HFILES = nghttp2_pq_test.h nghttp2_map_test.h nghttp2_queue_test.h \
48	nghttp2_session_test.h \
49	nghttp2_frame_test.h nghttp2_stream_test.h nghttp2_hd_test.h \
50	nghttp2_alpn_test.h nghttp2_helper_test.h \
51	nghttp2_assertion.h \
52	nghttp2_test_helper.h \
53	nghttp2_buf_test.h \
54	nghttp2_http_test.h \
55	nghttp2_extpri_test.h \
56	nghttp2_ratelim_test.h \
57	munit/munit.h
58
59main_SOURCES = $(HFILES) $(OBJECTS)
60
61if ENABLE_STATIC
62main_LDADD = ${top_builddir}/lib/libnghttp2.la
63else
64# With static lib disabled and symbol hiding enabled, we have to link object
65# files directly because the tests use symbols not included in public API.
66main_LDADD = ${top_builddir}/lib/.libs/*.o
67endif
68
69main_LDADD += @TESTLDADD@
70main_LDFLAGS = -static
71
72if ENABLE_FAILMALLOC
73failmalloc_SOURCES = failmalloc.c failmalloc_test.c failmalloc_test.h \
74	malloc_wrapper.c malloc_wrapper.h \
75	nghttp2_test_helper.c nghttp2_test_helper.h \
76	munit/munit.c munit/munit.h
77failmalloc_LDADD = $(main_LDADD)
78failmalloc_LDFLAGS = $(main_LDFLAGS)
79endif # ENABLE_FAILMALLOC
80
81AM_CFLAGS = $(WARNCFLAGS) \
82	-I${top_srcdir}/lib \
83	-I${top_srcdir}/lib/includes \
84	-I${top_srcdir}/tests/munit \
85	-I${top_builddir}/lib/includes \
86	-DBUILDING_NGHTTP2 \
87	-DNGHTTP2_STATICLIB \
88	@DEFS@
89
90TESTS = main
91
92if ENABLE_FAILMALLOC
93TESTS += failmalloc
94endif # ENABLE_FAILMALLOC
95