AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1)
AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd])
-AM_CONDITIONAL(HAVE_REST, [test x$lmhd = x1 -a x$jansson = x1])
-
AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1])
# restore LIBS
endif
-if HAVE_REST
+if HAVE_JSON
+if HAVE_MHD
PROVIDER_DIR = identity-provider
endif
+endif
if HAVE_JSON
JSON_DIR = json
POSTGRES_DIR = pq postgres
endif
-if HAVE_REST
+if HAVE_MHD
REST_DIR = rest
if HAVE_JSON
JSONAPI_DIR = jsonapi
libgnunet_plugin_gnsrecord_gns.la
-if HAVE_REST
+if HAVE_MHD
+if HAVE_JSON
plugin_LTLIBRARIES += libgnunet_plugin_rest_gns.la
endif
+endif
libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
plugin_gnsrecord_gns.c
libexec_PROGRAMS = \
gnunet-service-identity
-if HAVE_REST
+if HAVE_MHD
+if HAVE_JSON
plugin_LTLIBRARIES = \
libgnunet_plugin_rest_identity.la \
libgnunet_plugin_gnsrecord_identity.la
endif
+endif
gnunet_service_identity_SOURCES = \
$(TESTING_TESTS)
endif
-if HAVE_REST
+if HAVE_MHD
+if HAVE_JSON
REST_PLUGIN=libgnunet_plugin_rest_namestore.la
endif
+endif
if ENABLE_TEST_RUN
AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
rest.c
libgnunetrest_la_LIBADD = \
$(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
- $(GN_LIBINTL) -lmicrohttpd -ljansson
+ $(GN_LIBINTL) -lmicrohttpd
libgnunetrest_la_LDFLAGS = \
$(GN_LIB_LDFLAGS) \
-version-info 0:0:0
}
/**
- * Create JSON API MHD response
+ * Create MHD response
*
- * @param data JSON result
+ * @param data result
* @retun MHD response
*/
struct MHD_Response*
-GNUNET_REST_create_json_response (const char *data)
+GNUNET_REST_create_response (const char *data)
{
struct MHD_Response *resp;
size_t len;
resp = MHD_create_response_from_buffer (len,
(void*)data,
MHD_RESPMEM_MUST_COPY);
- MHD_add_response_header (resp,MHD_HTTP_HEADER_CONTENT_TYPE,"application/json");
return resp;
}