Add support for doas.
[oweals/gnunet.git] / src / transport / Makefile.am
index 73296abf9a0cc4ecbc7376828f1c3bcd101a14fa..178ecc737970f804f24c3ce23b7a96a7f9b1fd91 100644 (file)
@@ -9,10 +9,9 @@ libexecdir= $(pkglibdir)/libexec/
 
 pkgcfg_DATA = \
   transport.conf \
-  communicator-unix.conf 
+  communicator-unix.conf
 
 if HAVE_MHD
- GN_LIBMHD = -lmicrohttpd
  HTTP_SERVER_PLUGIN_LA = libgnunet_plugin_transport_http_server.la
  HTTPS_SERVER_PLUGIN_LA = libgnunet_plugin_transport_https_server.la
  HTTP_SERVER_PLUGIN_TEST = test_plugin_http_server
@@ -94,11 +93,19 @@ if LINUX
                test_quota_compliance_wlan_asymmetric
 endif
 
+if HAVE_SUDO
+SUDO_OR_DOAS_BINARY= $(SUDO_BINARY)
+else
+if HAVE_DOAS_BINARY
+SUDO_OR_DOAS_BINARY= $(DOAS_BINARY)
+endif
+endif
+
 if LINUX
 install-exec-hook:
-       $(top_srcdir)/src/transport/install-wlan-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true
+       $(top_srcdir)/src/transport/install-wlan-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_OR_DOAS_BINARY) || true
 if HAVE_LIBBLUETOOTH
-       $(top_srcdir)/src/transport/install-bluetooth-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true
+       $(top_srcdir)/src/transport/install-bluetooth-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_OR_DOAS_BINARY) || true
 endif
 else
 install-exec-hook:
@@ -115,18 +122,12 @@ if HAVE_LIBBLUETOOTH
  BT_QUOTA_TEST = test_quota_compliance_bluetooth \
     test_quota_compliance_bluetooth_asymmetric
 endif
-else
-if MINGW
- BT_BIN = gnunet-helper-transport-bluetooth
- BT_PLUGIN_LA = libgnunet_plugin_transport_bluetooth.la
-endif
 endif
 
 # end of HAVE_EXPERIMENTAL
 endif
 
 
-if !MINGW
 UNIX_PLUGIN_LA = libgnunet_plugin_transport_unix.la
 UNIX_PLUGIN_TEST = test_transport_api_unix
 UNIX_TEST = test_plugin_unix
@@ -137,21 +138,24 @@ UNIX_QUOTA_TEST = test_quota_compliance_unix \
 if LINUX
  UNIX_API_ABSTRACT_TEST = test_transport_api_unix_abstract
 endif
-endif
+
 
 noinst_PROGRAMS = \
  gnunet-transport-profiler \
- gnunet-communicator-unix \
+ gnunet-communicator-tcp \
+ gnunet-communicator-udp \
  gnunet-service-tng \
  $(WLAN_BIN_SENDER) \
  $(WLAN_BIN_RECEIVER)
 
 if HAVE_TESTING
-TESTING_LIBS = libgnunettransporttesting.la
+TESTING_LIBS = libgnunettransporttesting.la \
+                                                        libgnunettransporttesting2.la
 endif
 
 lib_LTLIBRARIES = \
   libgnunettransport.la \
+  libgnunettransportapplication.la \
   libgnunettransportcore.la \
   libgnunettransportcommunicator.la \
   libgnunettransportmonitor.la \
@@ -173,6 +177,15 @@ libgnunettransporttesting_la_LIBADD = \
 libgnunettransporttesting_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS)
 
+libgnunettransporttesting2_la_SOURCES = \
+  transport-testing2.c transport-testing2.h
+libgnunettransporttesting2_la_LIBADD = \
+  libgnunettransport.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/util/libgnunetutil.la
+libgnunettransporttesting2_la_LDFLAGS = \
+ $(GN_LIB_LDFLAGS)
+
 libgnunettransport_la_SOURCES = \
   transport.h \
   transport_api_address_to_string.c \
@@ -193,6 +206,14 @@ libgnunettransport_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
   -version-info 4:0:2
 
+libgnunettransportapplication_la_SOURCES = \
+  transport_api2_application.c
+libgnunettransportapplication_la_LIBADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(LTLIBINTL)
+libgnunettransportapplication_la_LDFLAGS = \
+  $(GN_LIB_LDFLAGS) $(WINFLAGS) \
+  -version-info 0:0:0
 
 
 libgnunettransportcore_la_SOURCES = \
@@ -228,21 +249,28 @@ libexec_PROGRAMS = \
  $(WLAN_BIN) \
  $(WLAN_BIN_DUMMY) \
  $(BT_BIN) \
- gnunet-service-transport
+ gnunet-service-transport \
+ gnunet-communicator-unix \
+ gnunet-communicator-udp \
+ gnunet-communicator-tcp
 
 
 
 bin_PROGRAMS = \
- gnunet-transport \
+ gnunet-transport
+
+bin_SCRIPTS = \
  gnunet-transport-certificate-creation
 
-#bin_SCRIPTS = \
-# gnunet-transport-certificate-creation
+# See: https://www.gnu.org/software/automake/manual/html_node/Scripts.html#Scripts
+do_subst = sed -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'
+
+
+gnunet-transport-certificate-creation: gnunet-transport-certificate-creation.in Makefile
+       $(do_subst) < $(srcdir)/gnunet-transport-certificate-creation.in > gnunet-transport-certificate-creation
+       chmod +x gnunet-transport-certificate-creation
+
 
-gnunet_transport_certificate_creation_SOURCES = \
- gnunet-transport-certificate-creation.c
-gnunet_transport_certificate_creation_LDADD = \
-  $(top_builddir)/src/util/libgnunetutil.la
 
 gnunet_communicator_unix_SOURCES = \
  gnunet-communicator-unix.c
@@ -251,6 +279,27 @@ gnunet_communicator_unix_LDADD = \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la
 
+gnunet_communicator_tcp_SOURCES = \
+ gnunet-communicator-tcp.c
+gnunet_communicator_tcp_LDADD = \
+  libgnunettransportcommunicator.la \
+  $(top_builddir)/src/nat/libgnunetnatnew.la \
+  $(top_builddir)/src/nt/libgnunetnt.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(LIBGCRYPT_LIBS)
+
+gnunet_communicator_udp_SOURCES = \
+ gnunet-communicator-udp.c
+gnunet_communicator_udp_LDADD = \
+  libgnunettransportapplication.la \
+  libgnunettransportcommunicator.la \
+  $(top_builddir)/src/nat/libgnunetnatnew.la \
+  $(top_builddir)/src/nt/libgnunetnt.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(LIBGCRYPT_LIBS)
+
 
 gnunet_helper_transport_wlan_SOURCES = \
  gnunet-helper-transport-wlan.c
@@ -272,13 +321,9 @@ gnunet_transport_wlan_receiver_LDADD = \
 
 gnunet_helper_transport_bluetooth_SOURCES = \
  gnunet-helper-transport-bluetooth.c
-if MINGW
- gnunet_helper_transport_bluetooth_LDADD = \
-  $(top_builddir)/src/util/libgnunetutil.la
- gnunet_helper_transport_bluetooth_LDFLAGS = -lws2_32
-else
- gnunet_helper_transport_bluetooth_LDFLAGS = -lbluetooth
-endif
+
+gnunet_helper_transport_bluetooth_LDFLAGS = -lbluetooth
+
 
 gnunet_transport_profiler_SOURCES = \
  gnunet-transport-profiler.c
@@ -321,18 +366,18 @@ gnunet_service_transport_LDADD = \
   $(GN_GLPK) \
   $(GN_LIBINTL)
 gnunet_service_transport_CFLAGS = \
-  $(CFLAGS)
+  $(AM_CFLAGS)
 # -DANALYZE
 
 
 gnunet_service_tng_SOURCES = \
  gnunet-service-tng.c
 gnunet_service_tng_LDADD = \
-  $(top_builddir)/src/ats/libgnunetats.la \
   $(top_builddir)/src/peerstore/libgnunetpeerstore.la \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la \
+  $(LIBGCRYPT_LIBS) \
   $(GN_LIBINTL)
 
 plugin_LTLIBRARIES = \
@@ -346,12 +391,6 @@ plugin_LTLIBRARIES = \
   $(WLAN_PLUGIN_LA) \
   $(BT_PLUGIN_LA)
 
-if HAVE_EXPERIMENTAL
-plugin_LTLIBRARIES += \
-  libgnunet_plugin_transport_xt.la \
-  libgnunet_plugin_transport_xu.la
-endif
-
 # Note: real plugins of course need to be added
 # to the plugin_LTLIBRARIES above
 noinst_LTLIBRARIES = \
@@ -369,18 +408,6 @@ libgnunet_plugin_transport_tcp_la_LIBADD = \
 libgnunet_plugin_transport_tcp_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
-libgnunet_plugin_transport_xt_la_SOURCES = \
-  plugin_transport_xt.c
-libgnunet_plugin_transport_xt_la_LIBADD = \
-  $(top_builddir)/src/hello/libgnunethello.la \
-  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
-  $(top_builddir)/src/nat/libgnunetnatnew.la \
-  $(top_builddir)/src/util/libgnunetutil.la \
-  $(LTLIBINTL)
-libgnunet_plugin_transport_xt_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
 libgnunet_plugin_transport_template_la_SOURCES = \
   plugin_transport_template.c
 libgnunet_plugin_transport_template_la_LIBADD = \
@@ -400,7 +427,7 @@ libgnunet_plugin_transport_wlan_la_LIBADD = \
 libgnunet_plugin_transport_wlan_la_LDFLAGS = \
   $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_wlan_la_CFLAGS = \
- $(CFLAGS) -DBUILD_WLAN
+ $(AM_CFLAGS) -DBUILD_WLAN
 
 libgnunet_plugin_transport_bluetooth_la_SOURCES = \
   plugin_transport_wlan.c plugin_transport_wlan.h
@@ -413,7 +440,7 @@ libgnunet_plugin_transport_bluetooth_la_LIBADD = \
 libgnunet_plugin_transport_bluetooth_la_LDFLAGS = \
   $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_bluetooth_la_CFLAGS = \
- $(CFLAGS) -DBUILD_BLUETOOTH
+ $(AM_CFLAGS) -DBUILD_BLUETOOTH
 
 libgnunet_plugin_transport_udp_la_SOURCES = \
   plugin_transport_udp.c plugin_transport_udp.h \
@@ -429,19 +456,6 @@ libgnunet_plugin_transport_udp_la_LIBADD = \
 libgnunet_plugin_transport_udp_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
-libgnunet_plugin_transport_xu_la_SOURCES = \
-  plugin_transport_xu.c plugin_transport_xu.h
-libgnunet_plugin_transport_xu_la_LIBADD = \
-  $(top_builddir)/src/hello/libgnunethello.la \
-  $(top_builddir)/src/fragmentation/libgnunetfragmentation.la \
-  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
-  $(top_builddir)/src/nat/libgnunetnatnew.la \
-  $(top_builddir)/src/util/libgnunetutil.la \
-  $(LTLIBINTL)
-libgnunet_plugin_transport_xu_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
 libgnunet_plugin_transport_unix_la_SOURCES = \
   plugin_transport_unix.c
 libgnunet_plugin_transport_unix_la_LIBADD = \
@@ -465,24 +479,22 @@ libgnunet_plugin_transport_http_client_la_LIBADD = \
 libgnunet_plugin_transport_http_client_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_http_client_la_CFLAGS = \
- $(CFLAGS)
-libgnunet_plugin_transport_http_client_la_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+ $(CPP_GNURL) $(AM_CFLAGS)
 
 
 libgnunet_plugin_transport_http_server_la_SOURCES = \
   plugin_transport_http_server.c plugin_transport_http_common.c
 libgnunet_plugin_transport_http_server_la_LIBADD = \
+  $(MHD_LIBS) \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   $(top_builddir)/src/nat/libgnunetnatnew.la \
   $(top_builddir)/src/util/libgnunetutil.la
 libgnunet_plugin_transport_http_server_la_LDFLAGS = \
- $(GN_LIBMHD) \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_http_server_la_CFLAGS = \
- $(CFLAGS)
+ $(MHD_CFLAGS) $(AM_CFLAGS)
 
 libgnunet_plugin_transport_https_client_la_SOURCES = \
   plugin_transport_http_client.c plugin_transport_http_common.c
@@ -495,24 +507,22 @@ libgnunet_plugin_transport_https_client_la_LIBADD = \
 libgnunet_plugin_transport_https_client_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_https_client_la_CFLAGS = \
- $(CFLAGS) -DBUILD_HTTPS
-libgnunet_plugin_transport_https_client_la_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+ $(CPP_GNURL) $(AM_CFLAGS) -DBUILD_HTTPS
 
 
 libgnunet_plugin_transport_https_server_la_SOURCES = \
   plugin_transport_http_server.c plugin_transport_http_common.c
 libgnunet_plugin_transport_https_server_la_LIBADD = \
+  $(MHD_LIBS) \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   $(top_builddir)/src/nat/libgnunetnatnew.la \
   $(top_builddir)/src/util/libgnunetutil.la
 libgnunet_plugin_transport_https_server_la_LDFLAGS = \
- $(GN_LIBMHD) \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_https_server_la_CFLAGS = \
- $(CFLAGS) -DBUILD_HTTPS
+ $(MHD_CFLAGS) $(AM_CFLAGS) -DBUILD_HTTPS
 
 
 if HAVE_TESTING
@@ -589,6 +599,8 @@ if HAVE_GETOPT_BINARY
 check_PROGRAMS += \
 test_transport_api_slow_ats
 endif
+check_PROGRAMS += \
+test_communicator_unix
 endif
 
 if ENABLE_TEST_RUN
@@ -767,6 +779,12 @@ test_plugin_udp_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la  \
  libgnunettransporttesting.la
 
+test_communicator_unix_SOURCES = \
+ test_communicator_unix.c
+test_communicator_unix_LDADD = \
+ libgnunettransporttesting2.la \
+ $(top_builddir)/src/util/libgnunetutil.la
+
 test_plugin_unix_SOURCES = \
  test_plugin_transport.c
 test_plugin_unix_LDADD = \
@@ -1058,6 +1076,7 @@ test_quota_compliance_http_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1067,6 +1086,7 @@ test_quota_compliance_http_asymmetric_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1076,6 +1096,7 @@ test_quota_compliance_https_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1085,6 +1106,7 @@ test_quota_compliance_https_asymmetric_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1203,6 +1225,7 @@ test_quota_compliance_tcp_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1211,6 +1234,7 @@ test_quota_compliance_tcp_asymmetric_SOURCES = \
 test_quota_compliance_tcp_asymmetric_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/ats/libgnunetats.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
@@ -1221,6 +1245,7 @@ test_quota_compliance_udp_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1230,6 +1255,7 @@ test_quota_compliance_unix_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1239,6 +1265,7 @@ test_quota_compliance_unix_asymmetric_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1248,6 +1275,7 @@ test_quota_compliance_wlan_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1257,6 +1285,7 @@ test_quota_compliance_wlan_asymmetric_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1266,6 +1295,7 @@ test_quota_compliance_bluetooth_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1275,6 +1305,7 @@ test_quota_compliance_bluetooth_asymmetric_LDADD = \
  libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/ats/libgnunetats.la \
+ $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
@@ -1304,6 +1335,8 @@ test_transport_api_slow_ats_LDADD = \
 
 
 EXTRA_DIST = \
+gnunet-transport-certificate-creation.in \
+communicator-unix.conf \
 test_plugin_hostkey \
 test_plugin_hostkey.ecc \
 test_delay \
@@ -1441,4 +1474,6 @@ test_transport_api_slow_ats_peer2.conf \
   tcp_connection_legacy.c \
   tcp_server_mst_legacy.c \
   tcp_server_legacy.c \
-  tcp_service_legacy.c
+  tcp_service_legacy.c \
+test_communicator_1.conf \
+test_communicator_1.conf