Use pkg-config to check for MHD
authorDavid Barksdale <amatus@amat.us>
Tue, 27 Aug 2019 19:29:17 +0000 (14:29 -0500)
committerDavid Barksdale <amatus@amat.us>
Tue, 27 Aug 2019 19:29:17 +0000 (14:29 -0500)
13 files changed:
configure.ac
src/auction/gnunet-auction-create.c
src/credential/Makefile.am
src/gns/Makefile.am
src/hostlist/Makefile.am
src/identity/Makefile.am
src/json/Makefile.am
src/namestore/Makefile.am
src/peerinfo-tool/Makefile.am
src/pt/Makefile.am
src/reclaim/Makefile.am
src/rest/Makefile.am
src/transport/Makefile.am

index 330b028755ca3f3c6e36c5e35c0fb5193cc8d671..3ddebf7a6c5199e318cbd2de2044e6ab9fe1cbd7 100644 (file)
@@ -1262,73 +1262,23 @@ AS_IF([test "$sqlite" = 0 -a "$mysql" = 0],
 
 # 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])
 
index a094d2a56f4597e49006e9d79738e6e380231823..3ee4d3554a5a7d1fc1777859a764f258278cb32a 100644 (file)
@@ -28,7 +28,7 @@
 #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
index f2550eca601f1bd7d8a229972b3a2c691223581c..bc6c49deb6756a4cd9a8a5939e88f014f41b2e08 100644 (file)
@@ -100,9 +100,10 @@ endif
 #      $(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)
 
 
 
index 642172e699e18c6cffd7f984d9d7ec1374bc549b..0d38cb51e3d521c7d1ec4b8eb7d4671fb7f60b9c 100644 (file)
@@ -122,9 +122,10 @@ libgnunet_plugin_rest_gns_la_LIBADD = \
   $(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 = \
@@ -158,7 +159,8 @@ gnunet_bcd_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 = \
@@ -180,8 +182,7 @@ endif
 
 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 \
@@ -189,12 +190,14 @@ gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
 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
index 17f0bdfa08cf670411f7856c737e76db5642ee06..a8621a2b0fef75ffbb2ab0c44795dea42179c679 100644 (file)
@@ -13,7 +13,8 @@ endif
 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
@@ -50,9 +51,10 @@ gnunet_daemon_hostlist_LDADD = \
   $(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 = \
index 476d981bb5528dad4260a13377bd8bc57abead64..9c87ec2c05024acc99fea4b90f579a52bfea387d 100644 (file)
@@ -35,9 +35,10 @@ libgnunet_plugin_rest_identity_la_LIBADD = \
   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 = \
index dfe185d5eff28675d0959bd2abb630dbc5e9a18c..886c0691d98bc5733956d48c8138b4947c8699ad 100644 (file)
@@ -12,6 +12,7 @@ lib_LTLIBRARIES = \
 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 \
@@ -22,7 +23,7 @@ libgnunetjson_la_LIBADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
   -ljansson \
-  -lmicrohttpd \
+  $(MHD_LIBS) \
   $(XLIB) \
   $(Z_LIBS)
 
@@ -58,8 +59,7 @@ test_json_mhd_LDADD = \
   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)
index e95add6c704a6ef9c048ae873b61f8c741158200..ad99a3f0b131c4b92edb1e396b626524901ee986 100644 (file)
@@ -143,9 +143,10 @@ libgnunet_plugin_rest_namestore_la_LIBADD = \
   $(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 = \
@@ -185,12 +186,13 @@ gnunet_namestore_LDADD = \
 
 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 = \
index a5fd602465de1e90d791b08240cf0c43b15b70b4..8293288c850b4095a0a39f31b095faefcb4bbbf0 100644 (file)
@@ -32,9 +32,10 @@ libgnunet_plugin_rest_peerinfo_la_LIBADD = \
   $(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 = \
index 188387c0c342942d4d7886b39188ccaba06cd6d5..1d94a342970b8c13832c576724cf4c2a3c51f658 100644 (file)
@@ -93,47 +93,42 @@ EXTRA_DIST = \
 
 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)
index 6e504643778233b8edafd57227dfdc21f34c0c8d..6937b1af6197261a8ee43ce2f920c47ee82ae9c6 100644 (file)
@@ -58,9 +58,10 @@ libgnunet_plugin_rest_reclaim_la_LIBADD = \
   $(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 = \
@@ -76,9 +77,10 @@ libgnunet_plugin_rest_openid_connect_la_LIBADD = \
   $(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 = \
index 8fe48198f896c17564c6352909adb3ae66e4f2e5..1fd2816c0fcff8fbe7eb4dff9fa143b8622c4f10 100644 (file)
@@ -37,34 +37,36 @@ libgnunet_plugin_rest_copying_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)
index e6729f2a98e61fd64773214fbc478230bd17b3db..a9b0d19d669f721975e741e96a16e4aaa3ae78a0 100644 (file)
@@ -12,7 +12,6 @@ pkgcfg_DATA = \
   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
@@ -369,7 +368,7 @@ gnunet_service_transport_LDADD = \
   $(GN_GLPK) \
   $(GN_LIBINTL)
 gnunet_service_transport_CFLAGS = \
-  $(CFLAGS)
+  $(AM_CFLAGS)
 # -DANALYZE
 
 
@@ -430,7 +429,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
@@ -443,7 +442,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 \
@@ -482,24 +481,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
@@ -512,24 +509,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