commit 77398cdb5522ecccf7a7a7163ad9f23b467889c1
parent e3ff894618ee5be5046cb7abd5fa4ddf46fba185
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 4 Mar 2018 13:08:22 +0100
check for dlfcn.h presence
Diffstat:
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -754,6 +754,9 @@ AC_CHECK_HEADER([[search.h]],
AM_CONDITIONAL([MHD_HAVE_TSEARCH], [[test "x$ac_cv_header_search_h" = xyes && test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]])
+AC_CHECK_HEADERS([dlfcn.h],[have_tlsplugin=yes],[have_tlsplugin=no], [AC_INCLUDES_DEFAULT])
+AM_CONDITIONAL([MHD_HAVE_TLS_PLUGIN], [[test "x$have_tlsplugin" = xyes]])
+
# Check for generic functions
AC_CHECK_FUNCS([rand random])
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
@@ -108,7 +108,7 @@ libmicrohttpd2_la_SOURCES = \
sysfdsetsize.c sysfdsetsize.h \
upgrade_process.c upgrade_process.h \
panic.c \
- version.c
+ version.c
libmicrohttpd2_la_CPPFLAGS = \
$(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \
@@ -116,9 +116,14 @@ libmicrohttpd2_la_CPPFLAGS = \
libmicrohttpd2_la_CFLAGS = \
$(AM_CFLAGS) $(MHD_LIB_CFLAGS)
libmicrohttpd2_la_LDFLAGS = \
- $(MHD_LIB_LDFLAGS) -ldl \
+ $(MHD_LIB_LDFLAGS) \
$(W32_MHD_LIB_LDFLAGS) \
-version-info 0:0:0 # FIXME: fix once closer to release...
+if MHD_HAVE_TLS_PLUGIN
+libmicrohttpd2_la_LDFLAGS += \
+ -ldl
+endif
+
libmicrohttpd2_la_LIBADD = \
$(MHD_LIBDEPS) # FIXME: should separate out GNUTLS_LIBS/GCRYPT here!
@@ -175,8 +180,3 @@ if ENABLE_BAUTH
# basicauth.c \
# base64.c base64.h
endif
-
-
-
-
-
diff --git a/src/lib/daemon_options.c b/src/lib/daemon_options.c
@@ -23,8 +23,9 @@
* @author Christian Grothoff
*/
#include "internal.h"
+#if HAVE_DLFCN_H
#include <dlfcn.h>
-
+#endif
/**
* Set logging method. Specify NULL to disable logging entirely. By
@@ -351,7 +352,7 @@ MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
const char *tls_backend,
const char *ciphers)
{
-#ifndef HTTPS_SUPPORT
+#if ! (defined(HTTPS_SUPPORT) && defined (HAVE_DLFCN_H))
return MHD_SC_TLS_DISABLED;
#else
char filename[1024];