# libmicrohttpd
lmhd=0
-AC_MSG_CHECKING([for libmicrohttpd])
+m4_define([MHD_MODULE], [libmicrohttpd >= 0.9.63])
AC_ARG_WITH(microhttpd,
- [ --with-microhttpd=PFX base of libmicrohttpd installation],
- [AC_MSG_RESULT([$with_microhttpd])
- AS_CASE([$with_microhttpd],
- [no],[],
- [yes|""],[
- AC_CHECK_HEADERS([microhttpd.h],
- AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
- AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
- [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.63])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- #include "$native_srcdir/src/include/platform.h"
- #include <microhttpd.h>
- #if (MHD_VERSION < 0x0096300)
- #error needs at least version 0.9.63
- #endif
- int main () { return 0; }
- ])],
- [AC_MSG_RESULT(ok)
- lmhd=1],
- [AC_MSG_RESULT(failed)])]),
- [],[#include "$native_srcdir/src/include/platform.h"
- #include <microhttpd.h>]),,
- [#include "$native_srcdir/src/include/platform.h"])
- ],[
- LDFLAGS="-L$with_microhttpd/lib $LDFLAGS"
- CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"
- AC_CHECK_HEADERS(microhttpd.h,
- AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
- AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
- EXT_LIB_PATH="-L$with_microhttpd/lib $EXT_LIB_PATH"
- [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- #include "$native_srcdir/src/include/platform.h"
- #include <microhttpd.h>
- #if (MHD_VERSION < 0x0094200)
- #error needs at least version 0.9.42
- #endif
- int main () { return 0; }
- ])],
- [AC_MSG_RESULT(ok)
- lmhd=1],
- [AC_MSG_RESULT(failed)])]),
- [],[#include "$native_srcdir/src/include/platform.h"
- #include <microhttpd.h>]),,
- [#include "$native_srcdir/src/include/platform.h"])
- ])
- ],
- [AC_MSG_RESULT([--with-microhttpd not specified])
- AC_CHECK_HEADERS([microhttpd.h],
- AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
- AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
- [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- #include "$native_srcdir/src/include/platform.h"
- #include <microhttpd.h>
- #if (MHD_VERSION < 0x0094200)
- #error needs at least version 0.9.52
- #endif
- ])],
- [AC_MSG_RESULT(ok)
- lmhd=1],
- [AC_MSG_RESULT(failed)])]),
- [],[#include "$native_srcdir/src/include/platform.h"
- #include <microhttpd.h>]),,
- [#include "$native_srcdir/src/include/platform.h"])])
+ [AS_HELP_STRING([--with-microhttpd[[=PFX]]],
+ [base of libmicrohttpd installation])],
+ [],
+ [with_microhttpd=check])
+AS_CASE([$with_microhttpd],
+ [no], [],
+ [yes], [PKG_CHECK_MODULES([MHD], [MHD_MODULE], [lmhd=1])],
+ [check], [PKG_CHECK_MODULES([MHD], [MHD_MODULE],
+ [lmhd=1],
+ [AC_MSG_WARN([Building without libmicrohttpd])])],
+ [SAVE_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
+ PKG_CONFIG_PATH=$with_microhttpd/lib/pkgconfig
+ export PKG_CONFIG_PATH
+ PKG_CHECK_MODULES([MHD], [MHD_MODULE], [lmhd=1])
+ PKG_CONFIG_PATH=$SAVE_PKG_CONFIG_PATH])
AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1)
AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd])
#include <float.h>
#include "gnunet_util_lib.h"
-#include "gnunet_json_lib.h"
+#include <jansson.h>
/* #include "gnunet_auction_service.h" */
#define FIRST_PRICE 0
# $(top_builddir)/src/rest/libgnunetrest.la \
# $(top_builddir)/src/identity/libgnunetidentity.la \
# $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
-# $(LTLIBINTL) -ljansson -lmicrohttpd
+# $(LTLIBINTL) -ljansson $(MHD_LIBS)
#libgnunet_plugin_rest_credential_la_LDFLAGS = \
# $(GN_PLUGIN_LDFLAGS)
+#libgnunet_plugin_rest_credential_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
$(top_builddir)/src/identity/libgnunetidentity.la \
$(top_builddir)/src/json/libgnunetjson.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
+ $(LTLIBINTL) -ljansson $(MHD_LIBS)
libgnunet_plugin_rest_gns_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_gns_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
gnunet-bcd.c
gnunet_bcd_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
- $(GN_LIBINTL) -lmicrohttpd
+ $(GN_LIBINTL) $(MHD_LIBS)
+gnunet_bcd_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
gnunet_dns2gns_SOURCES = \
gnunet_gns_proxy_SOURCES = \
gnunet-gns-proxy.c
-gnunet_gns_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(CPP_GNURL)
-gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
+gnunet_gns_proxy_LDADD = $(MHD_LIBS) $(LIB_GNURL) -lgnutls \
libgnunetgns.la \
$(top_builddir)/src/identity/libgnunetidentity.la \
$(top_builddir)/src/util/libgnunetutil.la \
if HAVE_GNUTLS_DANE
gnunet_gns_proxy_LDADD += -lgnutls-dane
endif
+gnunet_gns_proxy_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
test_gns_proxy_SOURCES = \
test_gns_proxy.c
-test_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
+test_gns_proxy_LDADD = $(MHD_LIBS) $(LIB_GNURL) -lgnutls \
$(top_builddir)/src/util/libgnunetutil.la \
$(GN_LIBINTL)
+test_gns_proxy_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
gnunet_gns_helper_service_w32_SOURCES = \
gnunet-gns-helper-service-w32.c
if HAVE_MHD
HOSTLIST_SERVER_SOURCES = \
gnunet-daemon-hostlist_server.c gnunet-daemon-hostlist_server.h
- GN_LIBMHD = -lmicrohttpd
+ GN_LIBMHD = $(MHD_LIBS)
+ GN_CPPMHD = $(MHD_CFLAGS)
endif
if HAVE_LIBGNURL
$(LIB_GNURL) \
$(GN_LIBINTL)
-gnunet_daemon_hostlist_CPPFLAGS = \
- $(CPP_GNURL) \
- $(AM_CPPFLAGS)
+gnunet_daemon_hostlist_CFLAGS = \
+ $(GN_CPPMHD) \
+ $(CPP_GNURL) \
+ $(AM_CFLAGS)
if HAVE_LIBGNURL
check_PROGRAMS = \
libgnunetidentity.la \
$(top_builddir)/src/rest/libgnunetrest.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
+ $(LTLIBINTL) -ljansson $(MHD_LIBS)
libgnunet_plugin_rest_identity_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_identity_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunetidentity_la_SOURCES = \
libgnunetjson_la_LDFLAGS = \
-version-info 0:0:0 \
-no-undefined
+libgnunetjson_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunetjson_la_SOURCES = \
json.c \
json_mhd.c \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
-ljansson \
- -lmicrohttpd \
+ $(MHD_LIBS) \
$(XLIB) \
$(Z_LIBS)
libgnunetjson.la \
$(top_builddir)/src/util/libgnunetutil.la \
-ljansson \
- -lmicrohttpd \
+ $(MHD_LIBS) \
$(Z_LIBS) \
$(LIB_GNURL)
-test_json_mhd_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+test_json_mhd_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
$(top_builddir)/src/json/libgnunetjson.la \
$(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
+ $(LTLIBINTL) -ljansson $(MHD_LIBS)
libgnunet_plugin_rest_namestore_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_namestore_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunetnamestore_la_SOURCES = \
gnunet_namestore_fcfsd_SOURCES = \
gnunet-namestore-fcfsd.c
-gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
+gnunet_namestore_fcfsd_LDADD = $(MHD_LIBS) \
$(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
$(top_builddir)/src/identity/libgnunetidentity.la \
libgnunetnamestore.la \
$(top_builddir)/src/util/libgnunetutil.la \
$(GN_LIBINTL)
+gnunet_namestore_fcfsd_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
gnunet_service_namestore_SOURCES = \
$(top_builddir)/src/rest/libgnunetrest.la \
$(top_builddir)/src/json/libgnunetjson.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
+ $(LTLIBINTL) -ljansson $(MHD_LIBS)
libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_peerinfo_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
gnunet_peerinfo_SOURCES = \
test_gns_vpn_SOURCES = \
test_gns_vpn.c
-test_gns_vpn_LDADD = -lmicrohttpd $(LIB_GNURL) \
+test_gns_vpn_LDADD = $(MHD_LIBS) $(LIB_GNURL) \
$(top_builddir)/src/namestore/libgnunetnamestore.la \
$(top_builddir)/src/identity/libgnunetidentity.la \
$(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
-test_gns_vpn_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+test_gns_vpn_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
test_gnunet_vpn_4_over_SOURCES = \
test_gnunet_vpn.c
-test_gnunet_vpn_4_over_LDADD = -lmicrohttpd $(LIB_GNURL) \
+test_gnunet_vpn_4_over_LDADD = $(MHD_LIBS) $(LIB_GNURL) \
$(top_builddir)/src/vpn/libgnunetvpn.la \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
-test_gnunet_vpn_4_over_CPPFLAGS = \
- $(LIB_GNURL) $(AM_CPPFLAGS)
+test_gnunet_vpn_4_over_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
test_gnunet_vpn_6_over_SOURCES = \
test_gnunet_vpn.c
-test_gnunet_vpn_6_over_LDADD = -lmicrohttpd $(LIB_GNURL) \
+test_gnunet_vpn_6_over_LDADD = $(MHD_LIBS) $(LIB_GNURL) \
$(top_builddir)/src/vpn/libgnunetvpn.la \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
-test_gnunet_vpn_6_over_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+test_gnunet_vpn_6_over_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
test_gnunet_vpn_4_to_6_SOURCES = \
test_gnunet_vpn.c
-test_gnunet_vpn_4_to_6_LDADD = -lmicrohttpd $(LIB_GNURL) \
+test_gnunet_vpn_4_to_6_LDADD = $(MHD_LIBS) $(LIB_GNURL) \
$(top_builddir)/src/vpn/libgnunetvpn.la \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
-test_gnunet_vpn_4_to_6_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+test_gnunet_vpn_4_to_6_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
test_gnunet_vpn_6_to_4_SOURCES = \
test_gnunet_vpn.c
-test_gnunet_vpn_6_to_4_LDADD = -lmicrohttpd $(LIB_GNURL) \
+test_gnunet_vpn_6_to_4_LDADD = $(MHD_LIBS) $(LIB_GNURL) \
$(top_builddir)/src/vpn/libgnunetvpn.la \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
-test_gnunet_vpn_6_to_4_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+test_gnunet_vpn_6_to_4_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
$(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
$(top_builddir)/src/namestore/libgnunetnamestore.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
+ $(LTLIBINTL) -ljansson $(MHD_LIBS)
libgnunet_plugin_rest_reclaim_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_reclaim_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunet_plugin_rest_openid_connect_la_SOURCES = \
$(top_builddir)/src/gns/libgnunetgns.la \
$(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -ljansson -lmicrohttpd
+ $(LTLIBINTL) -ljansson $(MHD_LIBS)
libgnunet_plugin_rest_openid_connect_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_openid_connect_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunet_plugin_gnsrecord_reclaim_la_SOURCES = \
libgnunet_plugin_rest_copying_la_LIBADD = \
libgnunetrest.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -lmicrohttpd
+ $(LTLIBINTL) $(MHD_LIBS)
libgnunet_plugin_rest_copying_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_copying_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunet_plugin_rest_config_la_SOURCES = \
plugin_rest_config.c
libgnunet_plugin_rest_config_la_LIBADD = \
libgnunetrest.la \
$(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL) -lmicrohttpd -ljansson
+ $(LTLIBINTL) $(MHD_LIBS) -ljansson
libgnunet_plugin_rest_config_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_rest_config_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
gnunet_rest_server_SOURCES = \
gnunet-rest-server.c
-
gnunet_rest_server_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
- $(GN_LIBINTL) -lmicrohttpd
+ $(GN_LIBINTL) $(MHD_LIBS)
+gnunet_rest_server_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
libgnunetrest_la_SOURCES = \
rest.c
libgnunetrest_la_LIBADD = \
$(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
- $(GN_LIBINTL) -lmicrohttpd
+ $(GN_LIBINTL) $(MHD_LIBS)
libgnunetrest_la_LDFLAGS = \
$(GN_LIB_LDFLAGS) \
-version-info 0:0:0
-
+libgnunetrest_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
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
$(GN_GLPK) \
$(GN_LIBINTL)
gnunet_service_transport_CFLAGS = \
- $(CFLAGS)
+ $(AM_CFLAGS)
# -DANALYZE
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
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 \
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
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