commit 18cbc4db48063de43d62041d286f297b8b3b308b
parent 5538ddaf3b91eb03f16c46d11cfa81344abbb2a4
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Wed, 12 Aug 2026 15:52:18 +0200
configure: corrected formatting of mhd_config.h
Diffstat:
| M | configure.ac | | | 103 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- |
1 file changed, 101 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -77,8 +77,8 @@ MHD_REQ_PRIVATE=''
MHD_LIBDEPS_PKGCFG=''
AH_TOP([#ifndef MHD_SYS_OPTIONS_H
-#error "mhd_config.h" must not be used directly
-#error include "mhd_sys_options.h" wrapper instead
+# error "mhd_config.h" must not be used directly
+# error include "mhd_sys_options.h" wrapper instead
#endif /* ! MHD_SYS_OPTIONS_H */])
AS_IF([test -z "$CC" && test -z "$CPP"], [
@@ -6388,6 +6388,105 @@ fail test here %%%@<:@-1@:>@
MHD_PKG_CONF_MODULE_VERSION([GNUTLS],[],[],[GNUTLS_MOD_VERSION='0'])
],[GNUTLS_MOD_VERSION='0']
)
+ CPPFLAGS="${CPPFLAGS_ac} ${GNUTLS_CPPFLAGS} ${user_CPPFLAGS}"
+ LDFLAGS="${LDFLAGS_ac} ${GNUTLS_LDFLAGS} ${user_LDFLAGS}"
+
+ # Check only for modern (>= 3.4.0) form of gnutls_handshake_set_hook_function()
+ MHD_CHECK_FUNC([gnutls_handshake_set_hook_function],
+ [[
+#if defined(HAVE_STDDEF_H)
+# include <stddef.h> /* NULL */
+#elif defined(HAVE_STDLIB_H)
+# include <stdlib.h> /* should provide NULL */
+#else
+# include <stdio.h> /* should provide NULL */
+#endif
+#include <gnutls/gnutls.h>
+
+int
+test_hook_f (gnutls_session_t session,
+ unsigned int htype,
+ unsigned when,
+ unsigned int incoming,
+ const gnutls_datum_t *msg);
+
+int
+test_hook_f (gnutls_session_t session,
+ unsigned int htype,
+ unsigned when,
+ unsigned int incoming,
+ const gnutls_datum_t *msg)
+{
+ (void) session; (void) htype; (void) when; (void) incoming;
+ return (NULL == msg) ? 0 : 1;
+}
+
+ ]],
+ [[
+ gnutls_handshake_hook_func hook = &test_hook_f;
+ gnutls_session_t sess = (gnutls_session_t) NULL;
+ gnutls_datum_t dat;
+
+ dat.data = (unsigned char *) NULL;
+ dat.size = 0u;
+
+ /* Match only modern (>= 3.4.0) form of gnutls_handshake_set_hook_function() */
+ gnutls_handshake_set_hook_function (sess, GNUTLS_HANDSHAKE_CLIENT_HELLO,
+ GNUTLS_HOOK_PRE, hook);
+ /* Strong check f][or a real typedef match. */
+ i][f (! hook (sess, GNUTLS_HANDSHAKE_CLIENT_HELLO, GNUTLS_HOOK_PRE,
+ 1, &dat))
+ return 1;
+ ]],
+ [],[],
+ [[$GNUTLS_LIBS]]
+ )
+
+ MHD_CHECK_FUNC([gnutls_ext_raw_parse],
+ [[
+#if defined(HAVE_STDDEF_H)
+# include <stddef.h> /* NULL */
+#elif defined(HAVE_STDLIB_H)
+# include <stdlib.h> /* should provide NULL */
+#else
+# include <stdio.h> /* should provide NULL */
+#endif
+#include <gnutls/gnutls.h>
+
+int
+test_ext_cb (void *ctx,
+ unsigned tls_id,
+ const unsigned char *data,
+ unsigned data_size);
+
+int
+test_ext_cb (void *ctx,
+ unsigned tls_id,
+ const unsigned char *data,
+ unsigned data_size)
+{
+ (void) ctx; (void) tls_id; (void) data_size;
+ return (NULL == data) ? 0 : 1;
+}
+
+ ]],
+ [[
+ gnutls_ext_raw_process_func cb = &test_ext_cb;
+ gnutls_datum_t dat;
+ unsigned char buf[2] = {0u, 0u};
+
+ dat.data = (unsigned char *) buf;
+ dat.size = 1u;
+ i][f (! gnutls_ext_raw_parse ((void *) buf, cb, &dat,
+ GNUTLS_EXT_RAW_FLAG_TLS_CLIENT_HELLO))
+ return 1;
+ ]],
+ [],[],
+ [[$GNUTLS_LIBS]]
+ )
+
+ LDFLAGS="${LDFLAGS_ac} ${user_LDFLAGS}"
+ CPPFLAGS="${CPPFLAGS_ac} ${user_CPPFLAGS}"
],
[
have_gnutls="no"