gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated (c310c029 -> 15e2a3a2)


From: gnunet
Subject: [libmicrohttpd] branch master updated (c310c029 -> 15e2a3a2)
Date: Sun, 03 Apr 2022 19:19:53 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from c310c029 configure: do not use sanitizers without run-time lib, unless 
explicitly requested
     new 0d42dbee configure: added "auto-optional" value for sanitizers 
parameter
     new 87a9c2bb configure: moved initialisation block
     new 66883d83 configure: modified z/OS settings
     new d39a3da5 mhd_norm_expd.m4: added autoconf helper macro
     new 203f6b60 mhd_check_func.m4: fixed macro
     new a0c836e6 configure: added workaround for problematic formating tools
     new 82a26bfe Added autoconf macro for checking compiler parameters/flags
     new 54fa890e configure: used more reliable test for -fvisibility
     new ccbeb19f Moved libtool-specific flags to Makefile
     new 29dfdc7c configure: added final reporting for *FLAGS
     new a3579e70 Added two helper macros to manipulate *FLAGS vars
     new 15e2a3a2 configure: netter format reporting for *FLAGS

The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                  | 291 ++++++++++++++++++++++++++----------------
 m4/mhd_append_flag_to_var.m4  |  46 +++++++
 m4/mhd_check_cc_flag.m4       | 254 ++++++++++++++++++++++++++++++++++++
 m4/mhd_check_func.m4          |  20 +--
 m4/mhd_norm_expd.m4           |  21 +++
 m4/mhd_prepend_flag_to_var.m4 |  46 +++++++
 src/microhttpd/Makefile.am    |   1 +
 7 files changed, 559 insertions(+), 120 deletions(-)
 create mode 100644 m4/mhd_append_flag_to_var.m4
 create mode 100644 m4/mhd_check_cc_flag.m4
 create mode 100644 m4/mhd_norm_expd.m4
 create mode 100644 m4/mhd_prepend_flag_to_var.m4

diff --git a/configure.ac b/configure.ac
index 8cced4e0..39587fe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # This file is part of libmicrohttpd.
 # (C) 2006-2021 Christian Grothoff (and other contributing authors)
-# (C) 2014-2021 Evgeny Grin (Karlson2k)
+# (C) 2014-2022 Evgeny Grin (Karlson2k)
 #
 # libmicrohttpd is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published
@@ -36,23 +36,40 @@ AC_SUBST(LIB_VERSION_CURRENT)
 AC_SUBST(LIB_VERSION_REVISION)
 AC_SUBST(LIB_VERSION_AGE)
 
-AC_MSG_CHECKING([[whether z/OS special settings are required]])
-AS_IF([test `uname -s` = "OS/390"],
-[
-# configure binaries for z/OS
-  AS_IF([test -z "$CC"],
-        [CC=`pwd`"/contrib/xcc"
-         chmod +x $CC || true])
-  AS_IF([test -z "$CPP"],
-        CPP="c89 -E")
-  AS_IF([test -z "$CXXCPP"],
-        CXXCPP="c++ -E -+")
-  AC_MSG_RESULT([[yes]])
-#  _CCC_CCMODE=1
-#  _C89_CCMODE=1
-],
-  AC_MSG_RESULT([[no]])
-)
+
+PACKAGE_VERSION_MAJOR='m4_car(m4_unquote(m4_split(AC_PACKAGE_VERSION, [\.])))'
+PACKAGE_VERSION_MINOR='m4_argn(2, m4_unquote(m4_split(AC_PACKAGE_VERSION, 
[\.])))'
+PACKAGE_VERSION_SUBMINOR='m4_argn(3, m4_unquote(m4_split(AC_PACKAGE_VERSION, 
[\.])))'
+AS_VAR_ARITH([MHD_W32_DLL_SUFF],[[$LIB_VERSION_CURRENT - $LIB_VERSION_AGE]])
+AC_SUBST([PACKAGE_VERSION_MAJOR])
+AC_SUBST([PACKAGE_VERSION_MINOR])
+AC_SUBST([PACKAGE_VERSION_SUBMINOR])
+AC_SUBST([MHD_W32_DLL_SUFF])
+AC_CONFIG_FILES([src/microhttpd/microhttpd_dll_res.rc])
+
+MHD_LIB_CPPFLAGS=""
+MHD_LIB_CFLAGS=""
+MHD_LIB_LDFLAGS=""
+MHD_LIBDEPS=""
+# for pkg-config
+MHD_REQ_PRIVATE=''
+MHD_LIBDEPS_PKGCFG=''
+
+AS_IF([test -z "$CC" && test -z "$CPP"], [
+  AC_MSG_CHECKING([[whether z/OS special settings are required]])
+  AS_IF([test `uname -s` = "OS/390"],
+    [
+      # configure binaries for z/OS
+      AS_IF([test -z "$CC"],
+            [CC=`pwd`"/contrib/xcc"
+             chmod +x $CC || true])
+      AS_IF([test -z "$CPP"],
+            CPP="c89 -E")
+      AC_MSG_RESULT([[yes]])
+    ],
+    [AC_MSG_RESULT([[no]])]
+  )
+])
 
 # Checks for programs.
 AC_PROG_AWK
@@ -77,6 +94,8 @@ AC_PROG_CC_STDC
   ]
 )
 
+# Workaround for libgcrypt
+AS_IF([[test "x$lt_sysroot" != "x" && test "x$SYSROOT" = "x"]], 
[[SYSROOT="$lt_sysroot"]])
 user_CFLAGS="$CFLAGS"
 user_LDFLAGS="$LDFLAGS"
 user_CPPFLAGS="$CPPFLAGS"
@@ -170,7 +189,6 @@ AC_CHECK_HEADERS([sys/sysctl.h netinet/ip_icmp.h 
netinet/icmp_var.h], [], [],
   ]]
 )
 
-
 # Adam shostack suggests the following for Windows:
 # -D_FORTIFY_SOURCE=2 -fstack-protector-all
 AC_ARG_ENABLE([gcc-hardening],
@@ -193,29 +211,8 @@ AC_ARG_ENABLE([linker-hardening],
 LDFLAGS="${LDFLAGS_ac} ${user_LDFLAGS}"
 
 
-# Workaround for libgcrypt
-AS_IF([[test "x$lt_sysroot" != "x" && test "x$SYSROOT" = "x"]], 
[[SYSROOT="$lt_sysroot"]])
-
-PACKAGE_VERSION_MAJOR='m4_car(m4_unquote(m4_split(AC_PACKAGE_VERSION, [\.])))'
-PACKAGE_VERSION_MINOR='m4_argn(2, m4_unquote(m4_split(AC_PACKAGE_VERSION, 
[\.])))'
-PACKAGE_VERSION_SUBMINOR='m4_argn(3, m4_unquote(m4_split(AC_PACKAGE_VERSION, 
[\.])))'
-AS_VAR_ARITH([MHD_W32_DLL_SUFF],[[$LIB_VERSION_CURRENT - $LIB_VERSION_AGE]])
-AC_SUBST([PACKAGE_VERSION_MAJOR])
-AC_SUBST([PACKAGE_VERSION_MINOR])
-AC_SUBST([PACKAGE_VERSION_SUBMINOR])
-AC_SUBST([MHD_W32_DLL_SUFF])
-AC_CONFIG_FILES([src/microhttpd/microhttpd_dll_res.rc])
-
-MHD_LIB_CPPFLAGS=""
-MHD_LIB_CFLAGS=""
-MHD_LIB_LDFLAGS=""
-MHD_LIBDEPS=""
-# for pkg-config
-MHD_REQ_PRIVATE=''
-MHD_LIBDEPS_PKGCFG=''
-
-AH_TEMPLATE([[HAVE_STDBOOL_H]], [Define to 1 if you have the <stdbool.h> 
header file and <stdbool.h> defines 'bool' type.])
-AH_TEMPLATE([[HAVE_REAL_BOOL]], [Define to 1 if you have the real boolean 
type.])
+AH_TEMPLATE([[HAVE_STDBOOL_H]], [Define to 1 i][f you have the <stdbool.h> 
header file and <stdbool.h> defines 'bool' type.])
+AH_TEMPLATE([[HAVE_REAL_BOOL]], [Define to 1 i][f you have the real boolean 
type.])
 AH_TEMPLATE([[bool]], [Define to type name which will be used as boolean 
type.])
 AC_CHECK_HEADER([stdbool.h],
   [
@@ -326,6 +323,7 @@ AX_CHECK_COMPILE_FLAG([[-Werror=attributes]],
    CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
   ],
                       [[errattr_CFLAGS=""]], [], [])
+
 AC_MSG_CHECKING([[for function inline keywords supported by $CC]])
 CFLAGS="${CFLAGS_ac} ${user_CFLAGS} $errattr_CFLAGS"
 inln_prfx="none"
@@ -1951,7 +1949,7 @@ MHD_CHECK_FUNC([[sysctl]], [[
 #ifdef HAVE_STDDEF_H
 #include <stddef.h>
 #endif
-  ]], [[int mib[2] = {CTL_KERN, KERN_MAXPROC}; if (sysctl(mib, 2, NULL, NULL, 
NULL, 0)) return 1;]]
+  ]], [[int mib[2] = {CTL_KERN, KERN_MAXPROC}; i][f (sysctl(mib, 2, NULL, 
NULL, NULL, 0)) return 1;]]
 )
 
 MHD_CHECK_FUNC([[sysctlbyname]], [[
@@ -1971,20 +1969,40 @@ MHD_CHECK_FUNC([[usleep]], [[#include <unistd.h>]], 
[[usleep(100000);]])
 MHD_CHECK_FUNC([[nanosleep]], [[#include <time.h>]], [[struct timespec ts2, 
ts1 = {0, 0}; nanosleep(&ts1, &ts2);]])
 
 HIDDEN_VISIBILITY_CFLAGS=""
-AS_CASE(["$host"],
-  [*-*-mingw*],[
-    dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
-    AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) 
__declspec(dllexport) extern],
-              [defines how to decorate public symbols while building])
-    HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
-  ],[
-    dnl on other compilers, check if we can do -fvisibility=hidden
-    AX_CHECK_LINK_FLAG([-fvisibility=hidden],
-      [AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
-                           [AC_DEFINE([_MHD_EXTERN], 
[__attribute__((visibility("default"))) extern],
-                                       [defines how to decorate public symbols 
while building])
-                            HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"])])
-   ])
+AH_TEMPLATE([_MHD_EXTERN],[defines how to decorate public symbols w][hile 
building the library])
+CFLAGS="${user_CFLAGS}"
+MHD_CHECK_CC_FLAG([-fvisibility=hidden],[CFLAGS_ac],
+  [
+    # NOTE: require setting of errattr_CFLAGS above
+    CFLAGS="${CFLAGS_ac} -fvisibility=hidden ${user_CFLAGS} ${errattr_CFLAGS}"
+    AC_CACHE_CHECK([whether $CC supports 
__attribute__((visibility("default")))],[mhd_cv_cc_attr_visibility],
+      [
+        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+extern __attribute__((visibility("default"))) int test_extrn_func(void);
+
+int test_extrn_func(void) {return 0;}
+              ]])
+          ],
+          [mhd_cv_cc_attr_visibility="yes"],[mhd_cv_cc_attr_visibility="no"]
+        )
+      ]
+    )
+    AS_VAR_IF([mhd_cv_cc_attr_visibility],["yes"],
+      [
+        HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
+        AS_IF([test "x$os_is_native_w32" = "xyes" && test "x$enable_shared" = 
"xyes"],
+          [AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) 
__declspec(dllexport) extern])],
+          [AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) 
extern])]
+        )
+      ],
+      [
+        AC_MSG_WARN([$CC supports -fvisibility, but does not support 
__attribute__((visibility("default"))). Check compiler and compiler flags.])
+        AC_DEFINE([_MHD_EXTERN], [extern])
+      ]
+    )
+  ],[AC_DEFINE([_MHD_EXTERN], [extern])]
+)
+CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
 AC_SUBST([HIDDEN_VISIBILITY_CFLAGS])
 
 # libcurl (required for testing)
@@ -2920,13 +2938,14 @@ AC_MSG_CHECKING([whether to enable run-time sanitizers])
 AC_ARG_ENABLE([sanitizers],
   [AS_HELP_STRING([[--enable-sanitizers[=address,undefined,leak,user-poison]]],
   [enable run-time sanitizers, specify the list of types of sanitizers to 
enable, ]
-  [leave the list empty (or set to "auto") to enable all suppoted and availabe 
]
+  [leave the list empty (or set to "auto") to enable all suppoted and 
available ]
   [sanitizers, or specify "auto-fallback" to use sanitizers even without ]
   [installed sanitizer run-time library])],
   [], [enable_sanitizers=no])
 AS_IF([test "x${enable_sanitizers}" = "x"], [enable_sanitizers="auto"])
 AS_VAR_IF([enable_sanitizers], ["yes"], [enable_sanitizers="auto"])
 AS_VAR_IF([enable_sanitizers], ["autofallback"], 
[enable_sanitizers="auto-fallback"])
+AS_VAR_IF([enable_sanitizers], ["autooptional"], 
[enable_sanitizers="auto-optional"])
 AS_IF([test "x${enable_sanitizers}" = "xno"],
   [
     enable_sanitizers="no"
@@ -2935,7 +2954,7 @@ AS_IF([test "x${enable_sanitizers}" = "xno"],
     enable_san_leak="no"
     enable_san_upoison="no"
   ],
-  [test "x${enable_sanitizers}" = "xauto"],
+  [test "x${enable_sanitizers}" = "xauto" || test "x${enable_sanitizers}" = 
"xauto-optional"],
   [
     enable_san_address="auto"
     enable_san_undef="auto"
@@ -2976,6 +2995,7 @@ AS_CASE([${enable_sanitizers}],
   [selected], [AC_MSG_RESULT([selected])],
   [auto], [AC_MSG_RESULT([yes, detect and use supported sanitizers])],
   [auto-fallback], [AC_MSG_RESULT([yes, detect and use supported sanitizers 
even without run-time lib])],
+  [auto-optional], [AC_MSG_RESULT([yes, detect and use supported sanitizers if 
any])],
   [AC_MSG_RESULT([no])]
 )
 AS_VAR_IF([enable_sanitizers], ["no"], [:],
@@ -3307,68 +3327,81 @@ int main(void)
          ]
        )
        AS_IF([test -z "${enabled_sanitizers}"],
-         [AC_MSG_ERROR([cannot find any sanitizer supported by $CC])])
-       AS_VAR_IF([enable_san_upoison], ["no"], [:],
          [
-           AC_MSG_CHECKING([whether to enable user memory poisoning])
-           AS_IF([test "x${mhd_cv_cc_sanitizer_address}" = "xyes" && test 
"x${mhd_cv_cc_sanitizer_pointer_compare}" = "xyes" && \
-             test "x${ac_cv_header_sanitizer_asan_interface_h}" = "xyes" && \
-             (test "x${mhd_cv_func_attribute_nosanitize_ptr}" = "xyes" || test 
"x${mhd_cv_func_attribute_nosanitize_addr}" = "xyes")],
+           AS_VAR_IF([enable_sanitizers], ["auto-optional"],
              [
-               AC_DEFINE([MHD_ASAN_POISON_ACTIVE], [1], [Define to '1' if user 
memory poison is used])
-               
enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+, }user-poison"
-               enable_san_upoison="yes"
-               AC_MSG_RESULT([yes])
+               san_FLAGS=""
+               san_CFLAGS=""
              ],
              [
-               AC_MSG_RESULT([no])
-               AS_VAR_IF([enable_san_upoison], ["yes"],
-                 [AC_MSG_ERROR([User memory poisoning cannot be enabled])])
-               enable_san_upoison="no"
+               AC_MSG_ERROR([cannot find any sanitizer supported by $CC])
              ]
            )
-         ]
-       )
-       AS_VAR_IF([enable_san_address], ["yes"],
-         [
-           CFLAGS="${CFLAGS_ac} ${san_FLAGS} ${san_CFLAGS} ${user_CFLAGS}"
-           AX_APPEND_COMPILE_FLAGS([-Wp,-U_FORTIFY_SOURCE], [san_CFLAGS])
-           AX_APPEND_FLAG([-D_FORTIFY_SOURCE=0], [san_CFLAGS])
          ],
          [
-           AS_CASE([$enable_sanitizers], [auto|auto-fallback],
-             [AC_MSG_WARN([$CC does not support address sanitizer])])
-         ]
-       )
-       CFLAGS="${CFLAGS_ac} ${san_FLAGS} ${san_CFLAGS} ${user_CFLAGS}"
-       # Always stop on sanitizer error
-       AX_APPEND_COMPILE_FLAGS([-fno-sanitize-recover=all], [san_CFLAGS])
-       # Get a better output for sanitizers error reporting
-       AX_APPEND_COMPILE_FLAGS([-fno-omit-frame-pointer 
-fno-optimize-sibling-calls],
-         [san_CFLAGS])
-       AS_VAR_IF([enable_san_address], ["yes"],
-         [
-           
AM_ASAN_OPTIONS="exitcode=88:strict_string_checks=1:detect_stack_use_after_return=1"
-           
AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:check_initialization_order=1:strict_init_order=1:redzone=64"
-           
AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:max_free_fill_size=1024:detect_invalid_pointer_pairs=3"
-           AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:handle_ioctl=1:halt_on_error=1"
-           AS_VAR_IF([enable_san_upoison], ["yes"], 
[AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:allow_user_poisoning=1"])
+           AS_VAR_IF([enable_san_upoison], ["no"], [:],
+             [
+               AC_MSG_CHECKING([whether to enable user memory poisoning])
+               AS_IF([test "x${mhd_cv_cc_sanitizer_address}" = "xyes" && test 
"x${mhd_cv_cc_sanitizer_pointer_compare}" = "xyes" && \
+                 test "x${ac_cv_header_sanitizer_asan_interface_h}" = "xyes" 
&& \
+                 (test "x${mhd_cv_func_attribute_nosanitize_ptr}" = "xyes" || 
test "x${mhd_cv_func_attribute_nosanitize_addr}" = "xyes")],
+                 [
+                   AC_DEFINE([MHD_ASAN_POISON_ACTIVE], [1], [Define to '1' if 
user memory poison is used])
+                   
enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+, }user-poison"
+                   enable_san_upoison="yes"
+                   AC_MSG_RESULT([yes])
+                 ],
+                 [
+                   AC_MSG_RESULT([no])
+                   AS_VAR_IF([enable_san_upoison], ["yes"],
+                     [AC_MSG_ERROR([User memory poisoning cannot be enabled])])
+                   enable_san_upoison="no"
+                 ]
+               )
+             ]
+           )
+           AS_VAR_IF([enable_san_address], ["yes"],
+             [
+               CFLAGS="${CFLAGS_ac} ${san_FLAGS} ${san_CFLAGS} ${user_CFLAGS}"
+               AX_APPEND_COMPILE_FLAGS([-Wp,-U_FORTIFY_SOURCE], [san_CFLAGS])
+               AX_APPEND_FLAG([-D_FORTIFY_SOURCE=0], [san_CFLAGS])
+             ],
+             [
+               AS_CASE([$enable_sanitizers], [auto|auto-fallback],
+                 [AC_MSG_WARN([$CC does not support address sanitizer])])
+             ]
+           )
+           CFLAGS="${CFLAGS_ac} ${san_FLAGS} ${san_CFLAGS} ${user_CFLAGS}"
+           # Always stop on sanitizer error
+           AX_APPEND_COMPILE_FLAGS([-fno-sanitize-recover=all], [san_CFLAGS])
+           # Get a better output for sanitizers error reporting
+           AX_APPEND_COMPILE_FLAGS([-fno-omit-frame-pointer 
-fno-optimize-sibling-calls],
+             [san_CFLAGS])
+           AS_VAR_IF([enable_san_address], ["yes"],
+             [
+               
AM_ASAN_OPTIONS="exitcode=88:strict_string_checks=1:detect_stack_use_after_return=1"
+               
AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:check_initialization_order=1:strict_init_order=1:redzone=64"
+               
AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:max_free_fill_size=1024:detect_invalid_pointer_pairs=3"
+               
AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:handle_ioctl=1:halt_on_error=1"
+               AS_VAR_IF([enable_san_upoison], ["yes"], 
[AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:allow_user_poisoning=1"])
+               AS_VAR_IF([enable_san_leak], ["yes"],
+                 [AS_VAR_IF([mhd_cv_cc_sanitizer_address_leak], ["yes"],
+                   [AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:detect_leaks=1"])
+                 ], [AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:detect_leaks=0"]
+               )
+             ]
+           )
+           AS_VAR_IF([enable_san_undef], [yes],
+             
[AM_UBSAN_OPTIONS="exitcode=87:print_stacktrace=1:halt_on_error=1"])
            AS_VAR_IF([enable_san_leak], ["yes"],
-             [AS_VAR_IF([mhd_cv_cc_sanitizer_address_leak], ["yes"],
-               [AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:detect_leaks=1"])
-             ], [AM_ASAN_OPTIONS="${AM_ASAN_OPTIONS}:detect_leaks=0"]
+             [AM_LSAN_OPTIONS="use_unaligned=1"]
            )
+           AM_TESTS_ENVIRONMENT='\
+    ASAN_OPTIONS="$(AM_ASAN_OPTIONS)" ; export ASAN_OPTIONS ; \
+    UBSAN_OPTIONS="$(AM_UBSAN_OPTIONS)" ; export UBSAN_OPTIONS ; \
+    LSAN_OPTIONS="$(AM_LSAN_OPTIONS)" ; export LSAN_OPTIONS ;'
          ]
        )
-       AS_VAR_IF([enable_san_undef], [yes],
-         [AM_UBSAN_OPTIONS="exitcode=87:print_stacktrace=1:halt_on_error=1"])
-       AS_VAR_IF([enable_san_leak], ["yes"],
-         [AM_LSAN_OPTIONS="use_unaligned=1"]
-       )
-       AM_TESTS_ENVIRONMENT='\
-ASAN_OPTIONS="$(AM_ASAN_OPTIONS)" ; export ASAN_OPTIONS ; \
-UBSAN_OPTIONS="$(AM_UBSAN_OPTIONS)" ; export UBSAN_OPTIONS ; \
-LSAN_OPTIONS="$(AM_LSAN_OPTIONS)" ; export LSAN_OPTIONS ;'
      ]
    )
    CFLAGS_ac="${CFLAGS_ac} ${san_FLAGS} ${san_CFLAGS}"
@@ -3382,7 +3415,7 @@ AC_SUBST([AM_UBSAN_OPTIONS])
 AC_SUBST([AM_LSAN_OPTIONS])
 AC_SUBST([AM_TESTS_ENVIRONMENT])
 
-MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS -export-dynamic -no-undefined"
+MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS"
 
 AC_SUBST([CPU_COUNT])
 AC_SUBST([HEAVY_TESTS_NOTPARALLEL])
@@ -3457,6 +3490,44 @@ src/testzzuf/Makefile])
 AC_OUTPUT
 
 # Finally: summary
+# Format flags without extra spaces for visual beauty
+fin_CPPFLAGS="$user_CPPFLAGS"
+fin_CFLAGS="$user_CFLAGS"
+fin_LDFLAGS="$user_LDFLAGS"
+MHD_PREPEND_FLAG_TO_VAR([fin_CPPFLAGS],[$CPPFLAGS_ac])
+MHD_PREPEND_FLAG_TO_VAR([fin_CFLAGS],[$CFLAGS_ac])
+MHD_PREPEND_FLAG_TO_VAR([fin_LDFLAGS],[$LDFLAGS_ac])
+fin_lib_CPPFLAGS="$user_CPPFLAGS"
+fin_lib_CFLAGS="$user_CFLAGS"
+fin_lib_LDFLAGS="$user_LDFLAGS"
+MHD_PREPEND_FLAG_TO_VAR([fin_lib_CPPFLAGS],[$MHD_LIB_CPPFLAGS])
+MHD_PREPEND_FLAG_TO_VAR([fin_lib_CFLAGS],[$MHD_LIB_CFLAGS])
+MHD_PREPEND_FLAG_TO_VAR([fin_lib_LDFLAGS],[$MHD_LIB_LDFLAGS])
+MHD_PREPEND_FLAG_TO_VAR([fin_lib_CPPFLAGS],[$CPPFLAGS_ac])
+MHD_PREPEND_FLAG_TO_VAR([fin_lib_CFLAGS],[$CFLAGS_ac])
+MHD_PREPEND_FLAG_TO_VAR([fin_lib_LDFLAGS],[$LDFLAGS_ac])
+AC_MSG_NOTICE([Toolchain flags:
+  CC=$CC
+  User/system flags:
+    CPPFLAGS="$user_CPPFLAGS"
+    CFLAGS="$user_CFLAGS"
+    LDFLAGS="$user_LDFLAGS"
+  Final set of the flags for tests and examples:
+    CPPFLAGS="$fin_CPPFLAGS"
+    CFLAGS="$fin_CFLAGS"
+    LDFLAGS="$fin_LDFLAGS"
+  Final set of the flags for ${PACKAGE_NAME} library:
+    CPPFLAGS="$fin_lib_CPPFLAGS"
+    CFLAGS="$fin_lib_CFLAGS"
+    LDFLAGS="$fin_lib_LDFLAGS"
+])
+AS_UNSET([fin_CPPFLAGS])
+AS_UNSET([fin_CFLAGS])
+AS_UNSET([fin_LDFLAGS])
+AS_UNSET([fin_lib_CPPFLAGS])
+AS_UNSET([fin_lib_CFLAGS])
+AS_UNSET([fin_lib_LDFLAGS])
+
 AS_IF([test "x$enable_curl" != "xyes"],
  [MSG_CURL="no, many unit tests will not run"],
  [MSG_CURL="yes"])
diff --git a/m4/mhd_append_flag_to_var.m4 b/m4/mhd_append_flag_to_var.m4
new file mode 100644
index 00000000..ee9e71cd
--- /dev/null
+++ b/m4/mhd_append_flag_to_var.m4
@@ -0,0 +1,46 @@
+# SYNOPSIS
+#
+#   MHD_APPEND_FLAG_TO_VAR([VARIABLE-TO-EXTEND], [FLAG-TO-APPEND])
+#
+# DESCRIPTION
+#
+#   This macro sets VARIABLE-TO-EXTEND to the value of VARIABLE-TO-EXTEND with
+#   appended FLAG-TO-APPEND. If current value of VARIABLE-TO-EXTEND and
+#   FLAG-TO-APPEND are both non-empty strings then space is added between them.
+#
+#   Example usage:
+#
+#     MHD_APPEND_FLAG_TO_VAR([my_CFLAGS], [-Wall])
+#
+#
+# LICENSE
+#
+#   Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([MHD_APPEND_FLAG_TO_VAR],[dnl
+m4_ifblank([$1],[m4_fatal([$0: First macro argument must not be empty])])dnl
+m4_bmatch([$1], [\$], [m4_fatal([$0: First macro argument must not contain 
'$'])])dnl
+m4_bmatch([$1], [,], [m4_fatal([$0: First macro argument must not contain 
','])])dnl
+m4_bmatch(_mhd_norm_expd([$1]), [\s],dnl
+[m4_fatal([$0: First macro argument must not contain whitespaces])])dnl
+m4_pushdef([varExtd],_mhd_norm_expd([$1]))dnl
+m4_bmatch([$2],[\$],dnl
+[dnl The second parameter is a variable value
+AS_IF([test -z "_mhd_norm_expd([$2])"],dnl
+[varExtd="${varExtd}"],dnl
+[AS_IF([test -z 
"${varExtd}"],[varExtd="_mhd_norm_expd([$2])"],[varExtd="${varExtd} 
_mhd_norm_expd([$2])"])])
+],dnl
+[dnl The second parameter is not a variable value
+m4_ifnblank(_mhd_norm_expd([$2]),dnl
+[AS_IF([test -z 
"${varExtd}"],[varExtd="_mhd_norm_expd([$2])"],[varExtd="${varExtd} 
_mhd_norm_expd([$2])"])
+],dnl
+[m4_n([varExtd="${varExtd}"])])])dnl m4_ifnblank m4_bmatch
+m4_popdef([varExtd])dnl
+])dnl AC_DEFUN
diff --git a/m4/mhd_check_cc_flag.m4 b/m4/mhd_check_cc_flag.m4
new file mode 100644
index 00000000..e6ba38f6
--- /dev/null
+++ b/m4/mhd_check_cc_flag.m4
@@ -0,0 +1,254 @@
+# SYNOPSIS
+#
+#   MHD_CHECK_CC_FLAG([FLAG-TO-TEST], [VARIABLE-TO-PREPEND-CFLAGS],
+#                     [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
+#
+# DESCRIPTION
+#
+#   This macro checks whether the specific compiler flag is supported.
+#   The check is performing by prepending FLAG-TO-TEST to CFLAGS, then
+#   prepending value of VARIABLE-TO-PREPEND-CFLAGS (if any) to CFLAGS, and
+#   then performing compile and link test. If test succeed without warnings,
+#   then the flag is considered to be suppoted. Otherwise, if compile and link
+#   without test flag can be done without any warning, the flag is considered
+#   to be unsuppoted.
+#
+#   Example usage:
+#
+#     MHD_CHECK_CC_FLAG([-Wshadow], [additional_CFLAGS],
+#                       [additional_CFLAGS="${additional_CFLAGS} -Wshadow"])
+#
+#   Defined cache variable used in check so if any test will not work
+#   correctly on some platform, user may simply fix it by giving cache
+#   variable in configure parameters, for example:
+#
+#     ./configure mhd_cv_cc_fl_supp__wshadow=no
+#
+#   This simplify building from source on exotic platforms as patching
+#   of configure.ac is not required to change results of tests.
+#
+# LICENSE
+#
+#   Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([MHD_CHECK_CC_FLAG],[dnl
+  AC_PREREQ([2.64])dnl for AS_VAR_IF, m4_ifnblank
+  AC_LANG_ASSERT([C])dnl
+  AC_REQUIRE([AC_PROG_CC])dnl
+  m4_ifblank([$1], [m4_fatal([$0: First macro argument must not be empty])])dnl
+  m4_bmatch(m4_normalize([$1]), [\s],dnl
+            [m4_fatal([$0: First macro argument must not contain 
whitespaces])])dnl
+  m4_bmatch(_mhd_norm_expd([$2]), [\s],dnl
+            [m4_fatal([$0: Second macro argument must not contain 
whitespaces])])dnl
+  m4_bmatch([$1], [\$], [m4_fatal([$0: First macro argument must not contain 
'$'])])dnl
+  m4_bmatch([$2], [\$], [m4_fatal([$0: Second macro argument must not contain 
'$'])])dnl
+  AC_REQUIRE([MHD_FIND_CC_FLAG_WARNPARAMS])dnl sets 'mhd_CFLAGS_params_warn' 
variable
+  _MHD_CHECK_CC_FLAG_BODY([$1],[$2],[$3],[$4],[mhd_CFLAGS_params_warn])dnl
+])
+
+
+# SYNOPSIS
+#
+#   _MHD_CHECK_CC_FLAG_BODY([FLAG-TO-TEST], [VARIABLE-TO-PREPEND-CFLAGS],
+#                           [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED],
+#                           [VARIABLE-TO-ENABLE-WARNS])
+#
+AC_DEFUN([_MHD_CHECK_CC_FLAG_BODY],[dnl
+  AC_LANG_ASSERT([C])dnl
+  m4_ifblank([$1], [m4_fatal([$0: First macro argument must not be empty])])dnl
+  m4_bmatch(_mhd_norm_expd([$1]), [\s],dnl
+            [m4_fatal([$0: First macro argument must not contain 
whitespaces])])dnl
+  m4_bmatch(_mhd_norm_expd([$2]), [\s],dnl
+            [m4_fatal([$0: Second macro argument must not contain 
whitespaces])])dnl
+  m4_bmatch([$1], [\$], [m4_fatal([$0: First macro argument must not contain 
'$'])])dnl
+  m4_bmatch([$2], [\$], [m4_fatal([$0: Second macro argument must not contain 
'$'])])dnl
+  m4_ifblank([$5], [m4_fatal([$0: Fifth macro argument must not be empty])])dnl
+  m4_bmatch([$5], [\$], [m4_fatal([$0: Fifth macro argument must not contain 
'$'])])dnl
+  AS_VAR_PUSHDEF([cv_Var], 
[mhd_cv_cc_fl_supp_]m4_bpatsubst(m4_tolower(_mhd_norm_expd([$1])),[[^a-z0-9]],[_]))dnl
+  dnl
+  AC_CACHE_CHECK([whether $[]CC supports _mhd_norm_expd([$1]) flag], cv_Var,
+    [dnl
+      AS_VAR_PUSHDEF([save_CFLAGS_Var], [mhd_check_cc_flag_save_CFLAGS])dnl
+      AS_VAR_SET([save_CFLAGS_Var],["${CFLAGS}"])
+      m4_ifnblank([$2],[dnl
+        m4_if(_mhd_norm_expd([$2]),[CFLAGS],
+          [CFLAGS="${save_CFLAGS_Var} _mhd_norm_expd([$1]) 
$[]{_mhd_norm_expd([$5])}"],
+          [CFLAGS="$[]{_mhd_norm_expd([$2])} _mhd_norm_expd([$1]) 
${save_CFLAGS_Var} $[]{_mhd_norm_expd([$5])}"])
+      ],[dnl
+        CFLAGS="_mhd_norm_expd([$1]) $[]CFLAGS $[]{_mhd_norm_expd([$5])}"
+      ])dnl
+      mhd_check_cc_flag_save_c_werror_flag="$ac_c_werror_flag"
+      ac_c_werror_flag=yes
+      [#] Reuse the same source for all the checks here
+      AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+int main(void)
+{
+  return 0;
+}
+      ]])])
+      AC_LINK_IFELSE([],
+        [AS_VAR_SET([cv_Var],["yes"])],
+        [ [#] Compile and link failed if test flag added
+          m4_ifnblank([$2],[dnl
+            m4_if(_mhd_norm_expd([$2]),[CFLAGS],
+              [CFLAGS="${save_CFLAGS_Var} $[]{_mhd_norm_expd([$5])}"],
+              [CFLAGS="$[]{_mhd_norm_expd([$2])} ${save_CFLAGS_Var} 
$[]{_mhd_norm_expd([$5])}"])
+          ],[dnl
+            CFLAGS="${save_CFLAGS_Var} $[]{_mhd_norm_expd([$5])}"
+            ])dnl
+          AC_LINK_IFELSE([],
+            [AS_VAR_SET([cv_Var],["no"])],
+            [ [#] Compile and link failed if test flag removed as well
+              m4_ifnblank([$2],[dnl
+                m4_if(_mhd_norm_expd([$2]),[CFLAGS],
+                  [CFLAGS="${save_CFLAGS_Var} _mhd_norm_expd([$1])"],
+                  [CFLAGS="$[]{_mhd_norm_expd([$2])} _mhd_norm_expd([$1]) 
${save_CFLAGS_Var}"])
+              ],[dnl
+                CFLAGS="_mhd_norm_expd([$1]) ${save_CFLAGS_Var}"
+              ])dnl
+              ac_c_werror_flag="$mhd_check_cc_flag_save_c_werror_flag"
+              AC_LINK_IFELSE([],
+                [AS_VAR_SET([cv_Var],["yes"])],
+                [AS_VAR_SET([cv_Var],["no"])],
+              )
+            ]
+          )
+        ]
+      )
+      ac_c_werror_flag="$mhd_check_cc_flag_save_c_werror_flag"
+      AS_VAR_SET([CFLAGS],["${save_CFLAGS_Var}"])
+      AS_UNSET(save_CFLAGS_Var)
+      AS_VAR_POPDEF([save_CFLAGS_Var])dnl
+    ]
+  )
+  m4_ifnblank([$3$4],[dnl
+    AS_VAR_IF([cv_Var], ["yes"], [$3], m4_default_nblank([$4]))
+    ])dnl
+  AS_VAR_POPDEF([cv_Var])dnl
+])
+
+
+#
+# SYNOPSIS
+#
+#   MHD_FIND_CC_FLAG_WARNPARAMS()
+#
+AC_DEFUN([MHD_FIND_CC_FLAG_WARNPARAMS],[dnl
+  AC_LANG_ASSERT([C])dnl
+  AC_REQUIRE([MHD_FIND_CC_FLAG_WWARN])dnl
+  mhd_CFLAGS_params_warn=''
+  _MHD_CHECK_CC_FLAG_BODY([-Wunused-command-line-argument],[],
+    [
+      AS_IF([test -z "$mhd_CFLAGS_params_warn"],
+        [mhd_CFLAGS_params_warn='-Wunused-command-line-argument'],
+        [mhd_CFLAGS_params_warn="$mhd_CFLAGS_params_warn 
-Wunused-command-line-argument"]
+      )
+    ],[],[mhd_cv_cc_flag_Wwarn]
+  )
+  _MHD_CHECK_CC_FLAG_BODY([-Wignored-optimization-argument],[],
+    [
+      AS_IF([test -z "$mhd_CFLAGS_params_warn"],
+        [mhd_CFLAGS_params_warn='-Wignored-optimization-argument'],
+        [mhd_CFLAGS_params_warn="$mhd_CFLAGS_params_warn 
-Wignored-optimization-argument"]
+      )
+    ],[],[mhd_cv_cc_flag_Wwarn]
+  )
+  _MHD_CHECK_CC_FLAG_BODY([-Winvalid-command-line-argument],[],
+    [
+      AS_IF([test -z "$mhd_CFLAGS_params_warn"],
+        [mhd_CFLAGS_params_warn='-Winvalid-command-line-argument'],
+        [mhd_CFLAGS_params_warn="$mhd_CFLAGS_params_warn 
-Winvalid-command-line-argument"]
+      )
+    ],[],[mhd_cv_cc_flag_Wwarn]
+  )
+  _MHD_CHECK_CC_FLAG_BODY([-Wunknown-argument],[],
+    [
+      AS_IF([test -z "$mhd_CFLAGS_params_warn"],
+        [mhd_CFLAGS_params_warn='-Wunknown-argument'],
+        [mhd_CFLAGS_params_warn="$mhd_CFLAGS_params_warn -Wunknown-argument"]
+      )
+    ],[],[mhd_cv_cc_flag_Wwarn]
+  )
+  AS_IF([test -z "$mhd_CFLAGS_params_warn"],
+    [mhd_CFLAGS_params_warn="$mhd_cv_cc_flag_Wwarn"],
+    [mhd_CFLAGS_params_warn="$mhd_cv_cc_flag_Wwarn $mhd_CFLAGS_params_warn"]
+  )
+])
+
+
+#
+# SYNOPSIS
+#
+#   MHD_FIND_CC_FLAG_WWARN()
+#
+AC_DEFUN([MHD_FIND_CC_FLAG_WWARN],[dnl
+  AC_PREREQ([2.64])dnl for AS_VAR_IF, m4_ifnblank
+  AC_REQUIRE([AC_PROG_CC])dnl
+  AC_LANG_ASSERT([C])dnl
+  AC_MSG_CHECKING([for $[]CC flag to warn on unknown -W parameters])
+  AC_CACHE_VAL([mhd_cv_cc_flag_Wwarn],
+    [
+      mhd_check_cc_flagwarn_save_c_werror_flag="$ac_c_werror_flag"
+      ac_c_werror_flag=yes
+      mhd_find_cc_Wwarn_save_CFLAGS="$CFLAGS"
+      AS_UNSET([mhd_cv_cc_flag_Wwarn])
+      for mhd_cv_cc_flag_Wwarn in '' '-Wunknown-warning-option' 
'-Werror=unknown-warning-option' ; do
+        AS_VAR_IF([mhd_cv_cc_flag_Wwarn], ["unknown"], [break])
+        [#] Reuse the same source for all the checks here
+        AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+int main(void)
+{
+  return 0;
+}
+        ]])])
+        CFLAGS="-Wmhd-noexist-flag $mhd_find_cc_Wwarn_save_CFLAGS 
$mhd_cv_cc_flag_Wwarn"
+        AC_LINK_IFELSE([],
+          [],
+          [ [#] Compile and link failed if test flag and non-existing flag 
added
+            CFLAGS="$mhd_find_cc_Wwarn_save_CFLAGS $mhd_cv_cc_flag_Wwarn"
+            AC_LINK_IFELSE([],
+              [ [#] Compile and link succeed if only test flag added
+                break
+              ]
+            )
+          ]
+        )
+      done
+      CFLAGS="$mhd_find_cc_Wwarn_save_CFLAGS"
+      AS_VAR_IF([mhd_cv_cc_flag_Wwarn], ["unknown"],
+        [
+          _AS_ECHO_LOG([No suitable flags detected. Check whether default 
flags are correct.])
+          AC_LINK_IFELSE([AC_LANG_SOURCE([[
+int main(void)
+{
+  return 0;
+}
+            ]])],
+            [:],
+            [ [#] Compile and link fails (or warns) with default flags
+              AC_MSG_WARN([Compiler warns (of fails) with default flags!])
+              AC_MSG_WARN([Check whether compiler and compiler flags are 
correct.])
+            ]
+          )
+        ]
+      )
+      CFLAGS="$mhd_find_cc_Wwarn_save_CFLAGS"
+      AS_UNSET([mhd_find_cc_Wwarn_save_CFLAGS])
+      ac_c_werror_flag="$mhd_check_cc_flagwarn_save_c_werror_flag"
+      AS_UNSET([mhd_check_cc_flagwarn_save_c_werror_flag])
+    ]
+  )
+  AS_IF([test -z "$mhd_cv_cc_flag_Wwarn"],
+    [AC_MSG_RESULT([none needed])],
+    [AC_MSG_RESULT([$mhd_cv_cc_flag_Wwarn])])
+  AS_VAR_IF([mhd_cv_cc_flag_Wwarn], ["unknown"],
+    [AC_MSG_WARN([Unable to find compiler flags to warn on unsupported -W 
options. Final compiler options may be suboptimal.])])
+
+])
diff --git a/m4/mhd_check_func.m4 b/m4/mhd_check_func.m4
index 42aefd86..342c12f9 100644
--- a/m4/mhd_check_func.m4
+++ b/m4/mhd_check_func.m4
@@ -48,19 +48,19 @@
 
 AC_DEFUN([MHD_CHECK_FUNC],[dnl
   AC_PREREQ([2.64])dnl for AS_VAR_IF, m4_ifblank, m4_ifnblank
-  m4_ifblank(m4_translit($1,[()],[  ]), [m4_fatal([First macro argument must 
not be empty])])dnl
-  m4_ifblank($3, [m4_fatal([Third macro argument must not be empty])])dnl
-  m4_bmatch(m4_normalize($1), [\s],dnl
+  m4_ifblank(m4_translit([$1],[()],[  ]), [m4_fatal([First macro argument must 
not be empty])])dnl
+  m4_ifblank([$3], [m4_fatal([Third macro argument must not be empty])])dnl
+  m4_bmatch(m4_normalize([$1]), [\s],dnl
             [m4_fatal([First macro argument must not contain whitespaces])])dnl
-  m4_if(m4_index($3, m4_normalize(m4_translit($1,[()],[  ]))), [-1], dnl
-        [m4_fatal([CHECK_CODE parameter (third macro argument) does not 
contain ']m4_normalize($1)[' token])])dnl
-  AS_VAR_PUSHDEF([cv_Var], 
[mhd_cv_func_]m4_bpatsubst(m4_normalize(m4_translit($1,[()],[  
])),[[^a-zA-Z0-9]],[_]))dnl
+  m4_if(m4_index([$3], m4_normalize(m4_translit([$1],[()],[  ]))), [-1], dnl
+        [m4_fatal([CHECK_CODE parameter (third macro argument) does not 
contain ']m4_normalize([$1])[' token])])dnl
+  AS_VAR_PUSHDEF([cv_Var], 
[mhd_cv_func_]m4_bpatsubst(_mhd_norm_expd(m4_translit([$1],[()],[  
])),[[^a-zA-Z0-9]],[_]))dnl
   dnl
-  AC_CACHE_CHECK([for function $1], [cv_Var],
+  AC_CACHE_CHECK([for function $1], cv_Var,
     [dnl
       m4_ifnblank([$6],[dnl
         mhd_check_func_SAVE_LIBS="$LIBS"
-        LIBS="$LIBS m4_normalize([$6])"
+        LIBS="$LIBS _mhd_norm_expd([$6])"
       ])dnl
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM([m4_default_nblank([$2],[AC_INCLUDES_DEFAULT])], 
[$3]) ],
@@ -71,8 +71,8 @@ AC_DEFUN([MHD_CHECK_FUNC],[dnl
       ])dnl
     ])
   AS_VAR_IF([cv_Var], ["yes"],
-            
[AC_DEFINE([[HAVE_]]m4_bpatsubst(m4_toupper(m4_normalize(m4_translit($1,[()],[  
]))),[[^A-Z0-9]],[_]),
-                       [1], [Define to 1 if you have the 
`]m4_normalize(m4_translit($1,[()],[  ]))[' function.])
+            
[AC_DEFINE([[HAVE_]]m4_bpatsubst(m4_toupper(_mhd_norm_expd(m4_translit([$1],[()],[
  ]))),[[^A-Z0-9]],[_]),
+                       [1], [Define to 1 if you have the 
']_mhd_norm_expd(m4_translit([$1],[()],[  ]))[' function.])
             m4_n([$4])dnl
             ], [$5])
   AS_VAR_POPDEF([cv_Var])dnl
diff --git a/m4/mhd_norm_expd.m4 b/m4/mhd_norm_expd.m4
new file mode 100644
index 00000000..c8ff4749
--- /dev/null
+++ b/m4/mhd_norm_expd.m4
@@ -0,0 +1,21 @@
+# SYNOPSIS
+#
+#   _mhd_norm_expd([macro])
+#
+# DESCRIPTION
+#
+#   Normalize string after expansion of the macros.
+#
+#
+# LICENSE
+#
+#   Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([_mhd_norm_expd],[m4_normalize(m4_expand([$1]))])
diff --git a/m4/mhd_prepend_flag_to_var.m4 b/m4/mhd_prepend_flag_to_var.m4
new file mode 100644
index 00000000..788ce3ca
--- /dev/null
+++ b/m4/mhd_prepend_flag_to_var.m4
@@ -0,0 +1,46 @@
+# SYNOPSIS
+#
+#   MHD_PREPEND_FLAG_TO_VAR([VARIABLE-TO-EXTEND], [FLAG-TO-PREPEND])
+#
+# DESCRIPTION
+#
+#   This macro sets VARIABLE-TO-EXTEND to the value of VARIABLE-TO-EXTEND with
+#   appended FLAG-TO-APPEND. If current value of VARIABLE-TO-EXTEND and
+#   FLAG-TO-APPEND are both non-empty strings then space is added between them.
+#
+#   Example usage:
+#
+#     MHD_PREPEND_FLAG_TO_VAR([my_CFLAGS], [-Wall])
+#
+#
+# LICENSE
+#
+#   Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([MHD_PREPEND_FLAG_TO_VAR],[dnl
+m4_ifblank([$1],[m4_fatal([$0: First macro argument must not be empty])])dnl
+m4_bmatch([$1], [\$], [m4_fatal([$0: First macro argument must not contain 
'$'])])dnl
+m4_bmatch([$1], [,], [m4_fatal([$0: First macro argument must not contain 
','])])dnl
+m4_bmatch(_mhd_norm_expd([$1]), [\s],dnl
+[m4_fatal([$0: First macro argument must not contain whitespaces])])dnl
+m4_pushdef([varExtd],_mhd_norm_expd([$1]))dnl
+m4_bmatch([$2],[\$],dnl
+[dnl The second parameter is a variable value
+AS_IF([test -z "_mhd_norm_expd([$2])"],dnl
+[varExtd="${varExtd}"],dnl
+[AS_IF([test -z 
"${varExtd}"],[varExtd="_mhd_norm_expd([$2])"],[varExtd="_mhd_norm_expd([$2]) 
${varExtd}"])])
+],dnl
+[dnl The second parameter is not a variable value
+m4_ifnblank(_mhd_norm_expd([$2]),dnl
+[AS_IF([test -z 
"${varExtd}"],[varExtd="_mhd_norm_expd([$2])"],[varExtd="_mhd_norm_expd([$2]) 
${varExtd}"])
+],dnl
+[m4_n([varExtd="${varExtd}"])])])dnl m4_ifnblank m4_bmatch
+m4_popdef([varExtd])dnl
+])dnl AC_DEFUN
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
index f5125ef3..fc742aae 100644
--- a/src/microhttpd/Makefile.am
+++ b/src/microhttpd/Makefile.am
@@ -111,6 +111,7 @@ libmicrohttpd_la_CFLAGS = \
 libmicrohttpd_la_LDFLAGS = \
   $(MHD_LIB_LDFLAGS) $(MHD_TLS_LIB_LDFLAGS) \
   $(W32_MHD_LIB_LDFLAGS) \
+  -export-dynamic -no-undefined \
   -version-info @LIB_VERSION_CURRENT@:@LIB_VERSION_REVISION@:@LIB_VERSION_AGE@
 libmicrohttpd_la_LIBADD = \
   $(MHD_LIBDEPS) $(MHD_TLS_LIBDEPS)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]