http test not built if plugin not
[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_CHECK = test_plugin_transport_http \
13                      test_transport_api_http \
14                      test_plugin_transport_reliability_http
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = --coverage -O0
19 endif
20
21 if LINUX
22 NATBIN = gnunet-nat-server gnunet-nat-client
23 install-exec-hook:
24         chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client || true
25         chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client || true
26 else
27 install-exec-hook:
28 endif
29
30
31 lib_LTLIBRARIES = \
32   libgnunettransport.la
33
34 libgnunettransport_la_SOURCES = \
35   transport_api.c transport.h \
36   transport_api_blacklist.c \
37   transport_api_address_lookup.c 
38 libgnunettransport_la_LIBADD = \
39   $(top_builddir)/src/hello/libgnunethello.la \
40   $(top_builddir)/src/util/libgnunetutil.la \
41   $(GN_LIBINTL) 
42 libgnunettransport_la_LDFLAGS = \
43   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
44   -version-info 0:0:0
45
46
47 bin_PROGRAMS = \
48  gnunet-transport \
49  gnunet-service-transport $(NATBIN)
50
51
52 gnunet_nat_server_SOURCES = \
53  gnunet-nat-server.c         
54
55 gnunet_nat_client_SOURCES = \
56  gnunet-nat-client.c         
57
58 gnunet_transport_SOURCES = \
59  gnunet-transport.c         
60 gnunet_transport_LDADD = \
61   $(top_builddir)/src/transport/libgnunettransport.la \
62   $(top_builddir)/src/util/libgnunetutil.la \
63   $(GN_LIBINTL)
64
65 gnunet_service_transport_SOURCES = \
66  gnunet-service-transport.c plugin_transport.h 
67 gnunet_service_transport_LDADD = \
68   $(top_builddir)/src/hello/libgnunethello.la \
69   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
70   $(top_builddir)/src/statistics/libgnunetstatistics.la \
71   $(top_builddir)/src/util/libgnunetutil.la \
72   $(GN_LIBINTL)
73
74
75 plugin_LTLIBRARIES = \
76   libgnunet_plugin_transport_tcp.la \
77   libgnunet_plugin_transport_udp.la \
78   $(HTTP_PLUGIN_LA) \
79   libgnunet_plugin_transport_template.la
80 # TODO: add nat, etc.
81
82 libgnunet_plugin_transport_tcp_la_SOURCES = \
83   plugin_transport_tcp.c
84 libgnunet_plugin_transport_tcp_la_LIBADD = \
85   $(top_builddir)/src/hello/libgnunethello.la \
86   $(top_builddir)/src/statistics/libgnunetstatistics.la \
87   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
88   $(top_builddir)/src/util/libgnunetutil.la 
89 libgnunet_plugin_transport_tcp_la_LDFLAGS = \
90  $(GN_PLUGIN_LDFLAGS)
91
92 libgnunet_plugin_transport_template_la_SOURCES = \
93   plugin_transport_template.c
94 libgnunet_plugin_transport_template_la_LIBADD = \
95   $(top_builddir)/src/util/libgnunetutil.la 
96 libgnunet_plugin_transport_template_la_LDFLAGS = \
97  $(GN_PLUGIN_LDFLAGS)
98
99 libgnunet_plugin_transport_udp_la_SOURCES = \
100   plugin_transport_udp.c
101 libgnunet_plugin_transport_udp_la_LIBADD = \
102   $(top_builddir)/src/hello/libgnunethello.la \
103   $(top_builddir)/src/statistics/libgnunetstatistics.la \
104   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
105   $(top_builddir)/src/util/libgnunetutil.la 
106 libgnunet_plugin_transport_udp_la_LDFLAGS = \
107  $(GN_PLUGIN_LDFLAGS)
108
109 #libgnunet_plugin_transport_udp_nat_la_SOURCES = \
110 #  plugin_transport_udp_nat.c
111 #libgnunet_plugin_transport_udp_nat_la_LIBADD = \
112 #  $(top_builddir)/src/hello/libgnunethello.la \
113 #  $(top_builddir)/src/statistics/libgnunetstatistics.la \
114 #  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
115 #  $(top_builddir)/src/util/libgnunetutil.la 
116 #libgnunet_plugin_transport_udp_nat_la_LDFLAGS = \
117 # $(GN_PLUGIN_LDFLAGS)
118
119 if HAVE_MHD 
120 libgnunet_plugin_transport_http_la_SOURCES = \
121   plugin_transport_http.c
122 libgnunet_plugin_transport_http_la_LIBADD = \
123   $(top_builddir)/src/hello/libgnunethello.la \
124   $(top_builddir)/src/statistics/libgnunetstatistics.la \
125   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
126   @LIBCURL@ \
127   $(top_builddir)/src/util/libgnunetutil.la 
128 libgnunet_plugin_transport_http_la_LDFLAGS = \
129  $(GN_LIBMHD) \
130  $(GN_PLUGIN_LDFLAGS)
131 endif
132
133 check_PROGRAMS = \
134  test_transport_api_tcp \
135  test_transport_api_tcp_nat \
136  test_transport_api_udp \
137  $(HTTP_PLUGIN_CHECK) \
138  test_transport_api_udp_nat \
139  test_transport_api_reliability_tcp \
140  test_transport_api_reliability_tcp_nat \
141  test_transport_api_reliability_udp
142 # TODO: add tests for nat, etc.
143
144 TESTS = \
145  test_transport_api_tcp \
146  test_transport_api_tcp_nat \
147  test_transport_api_udp \
148  test_transport_api_udp_nat \
149  $(HTTP_PLUGIN_CHECK) \
150  test_transport_api_reliability_tcp \
151  test_transport_api_reliability_tcp_nat
152
153 test_transport_api_tcp_SOURCES = \
154  test_transport_api.c
155 test_transport_api_tcp_LDADD = \
156  $(top_builddir)/src/transport/libgnunettransport.la \
157  $(top_builddir)/src/util/libgnunetutil.la  
158
159 test_transport_api_tcp_nat_SOURCES = \
160  test_transport_api.c
161 test_transport_api_tcp_nat_LDADD = \
162  $(top_builddir)/src/transport/libgnunettransport.la \
163  $(top_builddir)/src/util/libgnunetutil.la  
164
165 test_transport_api_reliability_tcp_SOURCES = \
166  test_transport_api_reliability.c
167 test_transport_api_reliability_tcp_LDADD = \
168  $(top_builddir)/src/transport/libgnunettransport.la \
169  $(top_builddir)/src/util/libgnunetutil.la  
170
171 test_transport_api_reliability_tcp_nat_SOURCES = \
172  test_transport_api_reliability.c
173 test_transport_api_reliability_tcp_nat_LDADD = \
174  $(top_builddir)/src/transport/libgnunettransport.la \
175  $(top_builddir)/src/util/libgnunetutil.la 
176
177 test_transport_api_reliability_udp_SOURCES = \
178  test_transport_api_reliability.c
179 test_transport_api_reliability_udp_LDADD = \
180  $(top_builddir)/src/transport/libgnunettransport.la \
181  $(top_builddir)/src/util/libgnunetutil.la   
182
183 test_transport_api_udp_SOURCES = \
184  test_transport_api.c
185 test_transport_api_udp_LDADD = \
186  $(top_builddir)/src/transport/libgnunettransport.la \
187  $(top_builddir)/src/util/libgnunetutil.la  
188
189 test_transport_api_udp_nat_SOURCES = \
190  test_transport_api.c
191 test_transport_api_udp_nat_LDADD = \
192  $(top_builddir)/src/transport/libgnunettransport.la \
193  $(top_builddir)/src/util/libgnunetutil.la  
194
195 if HAVE_MHD
196 test_transport_api_http_SOURCES = \
197  test_transport_api.c
198 test_transport_api_http_LDADD = \
199  $(top_builddir)/src/transport/libgnunettransport.la \
200  $(top_builddir)/src/util/libgnunetutil.la  
201
202 test_plugin_transport_http_SOURCES = \
203  test_plugin_transport_http.c
204 test_plugin_transport_http_LDADD = \
205  $(top_builddir)/src/transport/libgnunettransport.la \
206  $(top_builddir)/src/statistics/libgnunetstatistics.la \
207  @LIBCURL@ \
208  $(top_builddir)/src/util/libgnunetutil.la  
209
210 test_transport_api_reliability_http_SOURCES = \
211  test_transport_api_reliability.c
212 test_transport_api_reliability_http_LDADD = \
213  $(top_builddir)/src/transport/libgnunettransport.la \
214  $(top_builddir)/src/util/libgnunetutil.la   
215 endif
216
217 EXTRA_DIST = \
218   test_transport_api_data.conf \
219   test_transport_api_tcp_peer1.conf \
220   test_transport_api_tcp_peer2.conf \
221   test_transport_api_udp_peer1.conf \
222   test_transport_api_udp_peer2.conf \
223   test_transport_api_udp_nat_peer1.conf \
224   test_transport_api_udp_nat_peer2.conf \
225   test_transport_api_tcp_nat_peer1.conf \
226   test_transport_api_tcp_nat_peer2.conf \
227   test_plugin_transport_data.conf \
228   test_transport_api_http_peer1.conf \
229   test_transport_api_http_peer2.conf \
230   test_transport_api_rel_http_peer1.conf \
231   test_transport_api_rel_http_peer2.conf \
232   test_plugin_transport_data_http.conf