http test not built if plugin not
[oweals/gnunet.git] / src / transport / Makefile.am
index 71e6470e3bac65fb68fa193b4a0c3c19b547aadb..a6bf2de9d787d2f2ddd4af113479437bdf502038 100644 (file)
@@ -6,6 +6,14 @@ if MINGW
   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
 endif
 
+if HAVE_MHD
+ GN_LIBMHD = -lmicrohttpd
+ HTTP_PLUGIN_LA = libgnunet_plugin_transport_http.la
+ HTTP_PLUGIN_CHECK = test_plugin_transport_http \
+                     test_transport_api_http \
+                     test_plugin_transport_reliability_http
+endif
+
 if USE_COVERAGE
   AM_CFLAGS = --coverage -O0
 endif
@@ -28,7 +36,6 @@ libgnunettransport_la_SOURCES = \
   transport_api_blacklist.c \
   transport_api_address_lookup.c 
 libgnunettransport_la_LIBADD = \
-  $(top_builddir)/src/arm/libgnunetarm.la \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL) 
@@ -48,7 +55,6 @@ gnunet_nat_server_SOURCES = \
 gnunet_nat_client_SOURCES = \
  gnunet-nat-client.c         
 
-
 gnunet_transport_SOURCES = \
  gnunet-transport.c         
 gnunet_transport_LDADD = \
@@ -59,6 +65,7 @@ gnunet_transport_LDADD = \
 gnunet_service_transport_SOURCES = \
  gnunet-service-transport.c plugin_transport.h 
 gnunet_service_transport_LDADD = \
+  $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la \
@@ -68,9 +75,9 @@ gnunet_service_transport_LDADD = \
 plugin_LTLIBRARIES = \
   libgnunet_plugin_transport_tcp.la \
   libgnunet_plugin_transport_udp.la \
-  libgnunet_plugin_transport_udp_nat.la \
-  libgnunet_plugin_transport_template.la 
-# TODO: add http, nat, etc.
+  $(HTTP_PLUGIN_LA) \
+  libgnunet_plugin_transport_template.la
+# TODO: add nat, etc.
 
 libgnunet_plugin_transport_tcp_la_SOURCES = \
   plugin_transport_tcp.c
@@ -99,24 +106,49 @@ libgnunet_plugin_transport_udp_la_LIBADD = \
 libgnunet_plugin_transport_udp_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
-libgnunet_plugin_transport_udp_nat_la_SOURCES = \
-  plugin_transport_udp_nat.c
-libgnunet_plugin_transport_udp_nat_la_LIBADD = \
+#libgnunet_plugin_transport_udp_nat_la_SOURCES = \
+#  plugin_transport_udp_nat.c
+#libgnunet_plugin_transport_udp_nat_la_LIBADD = \
+#  $(top_builddir)/src/hello/libgnunethello.la \
+#  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+#  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+#  $(top_builddir)/src/util/libgnunetutil.la 
+#libgnunet_plugin_transport_udp_nat_la_LDFLAGS = \
+# $(GN_PLUGIN_LDFLAGS)
+
+if HAVE_MHD 
+libgnunet_plugin_transport_http_la_SOURCES = \
+  plugin_transport_http.c
+libgnunet_plugin_transport_http_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  @LIBCURL@ \
   $(top_builddir)/src/util/libgnunetutil.la 
-libgnunet_plugin_transport_udp_nat_la_LDFLAGS = \
+libgnunet_plugin_transport_http_la_LDFLAGS = \
+ $(GN_LIBMHD) \
  $(GN_PLUGIN_LDFLAGS)
+endif
 
 check_PROGRAMS = \
  test_transport_api_tcp \
+ test_transport_api_tcp_nat \
  test_transport_api_udp \
- test_transport_api_udp_nat
-# TODO: add tests for http, nat, etc.
-
-TESTS = $(check_PROGRAMS)
+ $(HTTP_PLUGIN_CHECK) \
+ test_transport_api_udp_nat \
+ test_transport_api_reliability_tcp \
+ test_transport_api_reliability_tcp_nat \
+ test_transport_api_reliability_udp
+# TODO: add tests for nat, etc.
+
+TESTS = \
+ test_transport_api_tcp \
+ test_transport_api_tcp_nat \
+ test_transport_api_udp \
+ test_transport_api_udp_nat \
+ $(HTTP_PLUGIN_CHECK) \
+ test_transport_api_reliability_tcp \
+ test_transport_api_reliability_tcp_nat
 
 test_transport_api_tcp_SOURCES = \
  test_transport_api.c
@@ -124,6 +156,30 @@ test_transport_api_tcp_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/util/libgnunetutil.la  
 
+test_transport_api_tcp_nat_SOURCES = \
+ test_transport_api.c
+test_transport_api_tcp_nat_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la  
+
+test_transport_api_reliability_tcp_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_tcp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la  
+
+test_transport_api_reliability_tcp_nat_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_tcp_nat_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la 
+
+test_transport_api_reliability_udp_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_udp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la   
+
 test_transport_api_udp_SOURCES = \
  test_transport_api.c
 test_transport_api_udp_LDADD = \
@@ -136,6 +192,28 @@ test_transport_api_udp_nat_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/util/libgnunetutil.la  
 
+if HAVE_MHD
+test_transport_api_http_SOURCES = \
+ test_transport_api.c
+test_transport_api_http_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la  
+
+test_plugin_transport_http_SOURCES = \
+ test_plugin_transport_http.c
+test_plugin_transport_http_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ @LIBCURL@ \
+ $(top_builddir)/src/util/libgnunetutil.la  
+
+test_transport_api_reliability_http_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_http_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la   
+endif
+
 EXTRA_DIST = \
   test_transport_api_data.conf \
   test_transport_api_tcp_peer1.conf \
@@ -144,4 +222,11 @@ EXTRA_DIST = \
   test_transport_api_udp_peer2.conf \
   test_transport_api_udp_nat_peer1.conf \
   test_transport_api_udp_nat_peer2.conf \
-  test_plugin_transport_data.conf
+  test_transport_api_tcp_nat_peer1.conf \
+  test_transport_api_tcp_nat_peer2.conf \
+  test_plugin_transport_data.conf \
+  test_transport_api_http_peer1.conf \
+  test_transport_api_http_peer2.conf \
+  test_transport_api_rel_http_peer1.conf \
+  test_transport_api_rel_http_peer2.conf \
+  test_plugin_transport_data_http.conf