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