test case configuration changes, to make nat tests more realistic
[oweals/gnunet.git] / src / transport / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 if MINGW
6   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
7 endif
8
9 if HAVE_MHD
10  GN_LIBMHD = -lmicrohttpd
11  HTTP_PLUGIN_LA = libgnunet_plugin_transport_http.la
12  HTTP_PLUGIN_TEST = test_plugin_transport_http
13  HTTP_API_TEST = test_transport_api_http
14  HTTP_REL_TEST = test_transport_api_reliability_http
15
16  HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
17  HTTPS_PLUGIN_TEST = test_plugin_transport_https
18  HTTPS_API_TEST = test_transport_api_https
19  HTTPS_REL_TEST = test_transport_api_reliability_https                     
20 endif
21
22 if USE_COVERAGE
23   AM_CFLAGS = --coverage -O0
24 endif
25
26 if HAVE_PCAP
27 if LINUX
28 WANBIN = gnunet-transport-wlan-helper
29 endif
30 endif
31
32 if LINUX
33 NATBIN = gnunet-nat-server gnunet-nat-client
34 install-exec-hook:
35         chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
36         chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
37 else
38 install-exec-hook:
39 endif
40
41 #noinst_PROGRAMS = ${check_PROGRAMS}
42
43 lib_LTLIBRARIES = \
44   libgnunettransport.la
45
46 libgnunettransport_la_SOURCES = \
47   transport_api.c transport.h \
48   transport_api_blacklist.c \
49   transport_api_address_lookup.c 
50 libgnunettransport_la_LIBADD = \
51   $(top_builddir)/src/hello/libgnunethello.la \
52   $(top_builddir)/src/util/libgnunetutil.la \
53   $(GN_LIBINTL) 
54 libgnunettransport_la_LDFLAGS = \
55   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
56   -version-info 0:0:0
57
58
59 bin_PROGRAMS = \
60  gnunet-transport \
61  $(WANBIN) \
62  gnunet-service-transport $(NATBIN)
63
64 bin_SCRIPTS = \
65  gnunet-transport-certificate-creation
66
67 gnunet_nat_server_SOURCES = \
68  gnunet-nat-server.c         
69
70 gnunet_transport_wlan_helper_SOURCES = \
71  gnunet-transport-wlan-helper.c         
72 gnunet_transport_wlan_helper_LDADD = \
73  -lpcap
74
75 gnunet_nat_client_SOURCES = \
76  gnunet-nat-client.c         
77
78 gnunet_transport_SOURCES = \
79  gnunet-transport.c         
80 gnunet_transport_LDADD = \
81   $(top_builddir)/src/transport/libgnunettransport.la \
82   $(top_builddir)/src/util/libgnunetutil.la \
83   $(GN_LIBINTL)
84
85 gnunet_service_transport_SOURCES = \
86  gnunet-service-transport.c plugin_transport.h 
87 gnunet_service_transport_LDADD = \
88   $(top_builddir)/src/hello/libgnunethello.la \
89   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
90   $(top_builddir)/src/statistics/libgnunetstatistics.la \
91   $(top_builddir)/src/util/libgnunetutil.la \
92   $(GN_LIBINTL)
93
94
95 plugin_LTLIBRARIES = \
96   libgnunet_plugin_transport_tcp.la \
97   libgnunet_plugin_transport_udp.la \
98   $(HTTP_PLUGIN_LA) \
99   $(HTTPS_PLUGIN_LA) \
100   libgnunet_plugin_transport_template.la
101 # TODO: add nat, etc.
102
103 libgnunet_plugin_transport_tcp_la_SOURCES = \
104   plugin_transport_tcp.c
105 libgnunet_plugin_transport_tcp_la_LIBADD = \
106   $(top_builddir)/src/hello/libgnunethello.la \
107   $(top_builddir)/src/statistics/libgnunetstatistics.la \
108   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
109   $(top_builddir)/src/util/libgnunetutil.la 
110 libgnunet_plugin_transport_tcp_la_LDFLAGS = \
111  $(GN_PLUGIN_LDFLAGS)
112
113 libgnunet_plugin_transport_template_la_SOURCES = \
114   plugin_transport_template.c
115 libgnunet_plugin_transport_template_la_LIBADD = \
116   $(top_builddir)/src/util/libgnunetutil.la 
117 libgnunet_plugin_transport_template_la_LDFLAGS = \
118  $(GN_PLUGIN_LDFLAGS)
119
120 libgnunet_plugin_transport_udp_la_SOURCES = \
121   plugin_transport_udp.c
122 libgnunet_plugin_transport_udp_la_LIBADD = \
123   $(top_builddir)/src/hello/libgnunethello.la \
124   $(top_builddir)/src/statistics/libgnunetstatistics.la \
125   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
126   $(top_builddir)/src/util/libgnunetutil.la 
127 libgnunet_plugin_transport_udp_la_LDFLAGS = \
128  $(GN_PLUGIN_LDFLAGS)
129
130 #libgnunet_plugin_transport_udp_nat_la_SOURCES = \
131 #  plugin_transport_udp_nat.c
132 #libgnunet_plugin_transport_udp_nat_la_LIBADD = \
133 #  $(top_builddir)/src/hello/libgnunethello.la \
134 #  $(top_builddir)/src/statistics/libgnunetstatistics.la \
135 #  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
136 #  $(top_builddir)/src/util/libgnunetutil.la 
137 #libgnunet_plugin_transport_udp_nat_la_LDFLAGS = \
138 # $(GN_PLUGIN_LDFLAGS)
139
140 if HAVE_MHD 
141 libgnunet_plugin_transport_http_la_SOURCES = \
142   plugin_transport_http.c
143 libgnunet_plugin_transport_http_la_LIBADD = \
144   $(top_builddir)/src/hello/libgnunethello.la \
145   $(top_builddir)/src/statistics/libgnunetstatistics.la \
146   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
147   @LIBCURL@ \
148   $(top_builddir)/src/util/libgnunetutil.la 
149 libgnunet_plugin_transport_http_la_LDFLAGS = \
150  $(GN_LIBMHD) \
151  $(GN_PLUGIN_LDFLAGS)
152  
153 libgnunet_plugin_transport_https_la_SOURCES = \
154   plugin_transport_https.c
155 libgnunet_plugin_transport_https_la_LIBADD = \
156   $(top_builddir)/src/hello/libgnunethello.la \
157   $(top_builddir)/src/statistics/libgnunetstatistics.la \
158   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
159   @LIBCURL@ \
160   $(top_builddir)/src/util/libgnunetutil.la 
161 libgnunet_plugin_transport_https_la_LDFLAGS = \
162  $(GN_LIBMHD) \
163  $(GN_PLUGIN_LDFLAGS) 
164 endif
165
166 check_PROGRAMS = \
167  test_transport_api_tcp \
168  test_transport_api_tcp_nat \
169  test_transport_api_udp \
170  test_transport_api_udp_nat \
171  $(HTTP_PLUGIN_TEST) \
172  $(HTTP_API_TEST) \
173  $(HTTPS_PLUGIN_TEST) \
174  $(HTTPS_API_TEST) \
175  test_transport_api_reliability_tcp \
176  test_transport_api_reliability_tcp_nat \
177  test_transport_api_reliability_udp \
178  $(HTTP_REL_TEST) \
179  $(HTTPS_REL_TEST)
180 # TODO: add tests for nat, etc.
181
182 if !DISABLE_TEST_RUN
183 TESTS = \
184  test_transport_api_tcp \
185  test_transport_api_tcp_nat \
186  test_transport_api_udp \
187  test_transport_api_udp_nat \
188  $(HTTP_PLUGIN_TEST) \
189  $(HTTP_API_TEST) \
190  $(HTTPS_PLUGIN_TEST) \
191  $(HTTPS_API_TEST) \
192  test_transport_api_reliability_tcp \
193  test_transport_api_reliability_tcp_nat \
194  $(HTTP_REL_TEST) \
195  $(HTTPS_REL_TEST)
196 endif
197
198 test_transport_api_tcp_SOURCES = \
199  test_transport_api.c
200 test_transport_api_tcp_LDADD = \
201  $(top_builddir)/src/transport/libgnunettransport.la \
202  $(top_builddir)/src/util/libgnunetutil.la  
203
204 test_transport_api_tcp_nat_SOURCES = \
205  test_transport_api.c
206 test_transport_api_tcp_nat_LDADD = \
207  $(top_builddir)/src/transport/libgnunettransport.la \
208  $(top_builddir)/src/util/libgnunetutil.la  
209
210 test_transport_api_reliability_tcp_SOURCES = \
211  test_transport_api_reliability.c
212 test_transport_api_reliability_tcp_LDADD = \
213  $(top_builddir)/src/transport/libgnunettransport.la \
214  $(top_builddir)/src/util/libgnunetutil.la  
215
216 test_transport_api_reliability_tcp_nat_SOURCES = \
217  test_transport_api_reliability.c
218 test_transport_api_reliability_tcp_nat_LDADD = \
219  $(top_builddir)/src/transport/libgnunettransport.la \
220  $(top_builddir)/src/util/libgnunetutil.la 
221
222 test_transport_api_reliability_udp_SOURCES = \
223  test_transport_api_reliability.c
224 test_transport_api_reliability_udp_LDADD = \
225  $(top_builddir)/src/transport/libgnunettransport.la \
226  $(top_builddir)/src/util/libgnunetutil.la   
227
228 test_transport_api_udp_SOURCES = \
229  test_transport_api.c
230 test_transport_api_udp_LDADD = \
231  $(top_builddir)/src/transport/libgnunettransport.la \
232  $(top_builddir)/src/util/libgnunetutil.la  
233
234 test_transport_api_udp_nat_SOURCES = \
235  test_transport_api.c
236 test_transport_api_udp_nat_LDADD = \
237  $(top_builddir)/src/transport/libgnunettransport.la \
238  $(top_builddir)/src/util/libgnunetutil.la  
239
240 if HAVE_MHD
241
242 test_plugin_transport_http_SOURCES = \
243  test_plugin_transport_http.c
244 test_plugin_transport_http_LDADD = \
245  $(top_builddir)/src/transport/libgnunettransport.la \
246  $(top_builddir)/src/statistics/libgnunetstatistics.la \
247  @LIBCURL@ \
248  $(top_builddir)/src/util/libgnunetutil.la  
249
250 test_transport_api_http_SOURCES = \
251  test_transport_api.c
252 test_transport_api_http_LDADD = \
253  $(top_builddir)/src/transport/libgnunettransport.la \
254  $(top_builddir)/src/util/libgnunetutil.la  
255
256 test_transport_api_reliability_http_SOURCES = \
257  test_transport_api_reliability.c
258 test_transport_api_reliability_http_LDADD = \
259  $(top_builddir)/src/transport/libgnunettransport.la \
260  $(top_builddir)/src/util/libgnunetutil.la
261  
262 test_plugin_transport_https_SOURCES = \
263  test_plugin_transport_https.c
264 test_plugin_transport_https_LDADD = \
265  $(top_builddir)/src/transport/libgnunettransport.la \
266  $(top_builddir)/src/statistics/libgnunetstatistics.la \
267  @LIBCURL@ \
268  $(top_builddir)/src/util/libgnunetutil.la  
269
270 test_transport_api_https_SOURCES = \
271  test_transport_api.c
272 test_transport_api_https_LDADD = \
273  $(top_builddir)/src/transport/libgnunettransport.la \
274  $(top_builddir)/src/util/libgnunetutil.la  
275  
276 test_transport_api_reliability_https_SOURCES = \
277  test_transport_api_reliability.c
278 test_transport_api_reliability_https_LDADD = \
279  $(top_builddir)/src/transport/libgnunettransport.la \
280  $(top_builddir)/src/util/libgnunetutil.la
281      
282 endif
283
284 EXTRA_DIST = \
285   test_transport_api_data.conf \
286   test_transport_api_tcp_peer1.conf \
287   test_transport_api_tcp_peer2.conf \
288   test_transport_api_udp_peer1.conf \
289   test_transport_api_udp_peer2.conf \
290   test_transport_api_udp_nat_peer1.conf \
291   test_transport_api_udp_nat_peer2.conf \
292   test_transport_api_tcp_nat_peer1.conf \
293   test_transport_api_tcp_nat_peer2.conf \
294   test_plugin_transport_data.conf \
295   test_transport_api_http_peer1.conf \
296   test_transport_api_http_peer2.conf \
297   test_transport_api_https_peer1.conf \
298   test_transport_api_https_peer2.conf \
299   test_transport_api_rel_http_peer1.conf \
300   test_transport_api_rel_http_peer2.conf \
301   test_transport_api_rel_https_peer1.conf \
302   test_transport_api_rel_https_peer2.conf \
303   test_plugin_transport_data_http.conf