gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (80eb2243 -> ad61ffab)


From: gnunet
Subject: [libmicrohttpd] branch master updated (80eb2243 -> ad61ffab)
Date: Wed, 15 Jun 2022 13:00:38 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 80eb2243 src/microhttpd/test_*: more compiler warning fixed
     new 0ea81caa configure: clarified messages for "build types"
     new ad61ffab configure: added parameter '--enable-compact-code'

The 2 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 | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 121 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8b37c19f..f505aa0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,17 +85,17 @@ AS_IF([test "x${enable_build_type}" = "x"], 
[enable_build_type="neutral"])
 AS_VAR_IF([enable_build_type], ["no"], [enable_build_type="neutral"])
 AS_VAR_IF([enable_build_type], ["yes"], [AC_MSG_ERROR([[Missing TYPE for 
--enable-build-type=]])])
 AS_CASE([${enable_build_type}],
-  [debug], [AC_MSG_RESULT([debug: enable asserts, sanitizers (if any 
supported), debug information, compiler optimisation for debugging])],
-  [debugger], [AC_MSG_RESULT([debuger: enable asserts, disable sanitizers, 
debug information, no compiler optimisation])],
-  [neutral], [AC_MSG_RESULT([neutral: use only user-specified compiler and 
linker flags])],
-  [release], [AC_MSG_RESULT([release: disable asserts, enable compiler 
optimisations])],
-  [release-compact], [AC_MSG_RESULT([release-compact: disable asserts, enable 
compiler optimisations for size, enable compact code])],
-  [release-hardened], [AC_MSG_RESULT([release-hardened: disable asserts, 
enable compiler optimisations, enable linker and compiler hardening])],
+  [debug], [AC_MSG_RESULT([debug. Defaults: enable asserts, sanitizers (if any 
supported), debug information, compiler optimisation for debugging])],
+  [debugger], [AC_MSG_RESULT([debuger. Defaults: enable asserts, disable 
sanitizers, debug information, no compiler optimisation])],
+  [neutral], [AC_MSG_RESULT([neutral. Defaults: use only user-specified 
compiler and linker flags])],
+  [release], [AC_MSG_RESULT([release. Defaults: disable asserts, enable 
compiler optimisations])],
+  [release-compact], [AC_MSG_RESULT([release-compact. Defaults: disable 
asserts, enable compiler optimisations for size, enable compact code])],
+  [release-hardened], [AC_MSG_RESULT([release-hardened. Defaults: disable 
asserts, enable compiler optimisations, enable linker and compiler hardening])],
   [AC_MSG_ERROR([[Unknown build type: ${enable_build_type}]])]
 )
 AS_VAR_IF([enable_build_type], ["neutral"], [:],
   [
-    # For all non-neutreal build types do not use automatic "-g -O2" for CFLAGS
+    # For all non-neutral build types do not use automatic "-g -O2" for CFLAGS
     AS_IF([test -z "${CFLAGS}"], [CFLAGS=""])
   ]
 )
@@ -138,6 +138,119 @@ CPPFLAGS="${CPPFLAGS_ac} ${user_CPPFLAGS}"
 LT_INIT([win32-dll])
 LT_LANG([Windows Resource])
 
+AC_ARG_ENABLE([compact-code],
+  [AS_HELP_STRING([[--enable-compact-code]],
+  [enable use of a reduced size version of the code, resulting in smaller ]
+  [binaries with a slight performance hit [auto]])],
+  [], [enable_compact_code=auto])
+AS_IF([test "x${enable_compact_code}" = "x"], [enable_compact_code="auto"])
+AH_TEMPLATE([[MHD_FAVOR_SMALL_CODE]], [Define to '1' to use compact code 
version])
+AH_TEMPLATE([[MHD_FAVOR_FAST_CODE]], [Define to '1' to use fast (and larger) 
code version])
+AS_UNSET([compact_code_MSG])
+AS_CASE([${enable_compact_code}], [auto],
+  [
+    # Parameter not set.
+    # Check preprocessor macros
+    AC_CHECK_DECL([MHD_FAVOR_SMALL_CODE],
+      [
+        enable_compact_code="yes"
+        compact_code_MSG="enabled by preprocessor macro"
+      ],
+      [],[/* no includes */]
+    )
+    AC_CHECK_DECL([MHD_FAVOR_FAST_CODE],
+      [
+        AS_VAR_IF([enable_compact_code],["yes"],
+          [AC_MSG_ERROR([Both MHD_FAVOR_SMALL_CODE and MHD_FAVOR_FAST_CODE 
macros are defined])]
+        )
+        enable_compact_code="no"
+        compact_code_MSG="set by preprocessor macro"
+      ],[],[/* no includes */]
+    )
+
+    AS_VAR_IF([enable_compact_code], ["auto"], 
+      [
+        # No preference by preprocessor macros
+        AC_CACHE_CHECK([whether compiler is configured to optimize for size],
+          [mhd_cv_cc_optim_size],
+          [
+            AC_COMPILE_IFELSE(
+              [
+                AC_LANG_PROGRAM([[
+#ifndef __OPTIMIZE_SIZE__
+#error Looks like compiler does not optimize for size
+choke me now
+#endif
+              ]],[])
+              ],
+              [mhd_cv_cc_optim_size="yes"],[mhd_cv_cc_optim_size="no"]
+            )
+          ]
+        )
+        AS_VAR_IF([mhd_cv_cc_optim_size], ["yes"],
+          [
+            enable_compact_code="yes"
+            compact_code_MSG="enabled automatically as compiler optimizes for 
size"
+            AC_DEFINE([MHD_FAVOR_SMALL_CODE],[1])
+          ]
+        )
+      ]
+    )
+
+    AS_VAR_IF([enable_compact_code], ["auto"], 
+      [
+        # No preference by preprocessor macros and compiler flags
+        AS_CASE([${enable_build_type}],[*-compact],
+          [
+            enable_compact_code="yes"
+            compact_code_MSG="enabled by build type ${enable_build_type}"
+            AC_DEFINE([MHD_FAVOR_SMALL_CODE],[1])
+          ]
+        )
+      ]
+    )
+
+    AS_VAR_IF([enable_compact_code], ["auto"], 
+      [
+        # No preference
+        enable_compact_code="no"
+        compact_code_MSG="by default"
+        AC_DEFINE([MHD_FAVOR_FAST_CODE],[1])
+      ]
+    )
+  ],
+  [yes],
+  [
+    compact_code_MSG="enabled by configure parameter"
+    AC_CHECK_DECL([MHD_FAVOR_SMALL_CODE],
+      [],
+      [AC_DEFINE([MHD_FAVOR_SMALL_CODE],[1])],[/* no includes */]
+    )
+    AC_CHECK_DECL([MHD_FAVOR_FAST_CODE],
+      [AC_MSG_ERROR([MHD_FAVOR_FAST_CODE macro is defined, 
--enable-compact-code could not be used])
+      ],
+      [],[/* no includes */]
+    )
+  ],
+  [no],
+  [
+    compact_code_MSG="disabled by configure parameter"
+    AC_CHECK_DECL([MHD_FAVOR_FAST_CODE],
+      [],
+      [AC_DEFINE([MHD_FAVOR_FAST_CODE],[1])],[/* no includes */]
+    )
+    AC_CHECK_DECL([MHD_FAVOR_SMALL_CODE],
+      [AC_MSG_ERROR([MHD_FAVOR_SMALL_CODE macro is defined, 
--disable-compact-code could not be used])
+      ],
+      [],[/* no includes */]
+    )
+  ],
+  [AC_MSG_ERROR([[Unknown parameter value: 
--enable-compact-code=${enable_compact_code}]])]
+)
+
+AC_MSG_CHECKING([whether to use a reduced size version of the code])
+AC_MSG_RESULT([${enable_compact_code} (${compact_code_MSG})])
+
 
 CFLAGS="${user_CFLAGS}"
 # Compiler options to always enable (if supported)
@@ -3824,6 +3937,7 @@ AC_MSG_NOTICE([GNU libmicrohttpd ${PACKAGE_VERSION} 
Configuration Summary:
   HTTPS support:     ${MSG_HTTPS}
   Threading lib:     ${USE_THREADS}
   Use thread names:  ${enable_thread_names}
+  Compact code:      ${enable_compact_code} (${compact_code_MSG})
   Use debug asserts: ${enable_asserts}
   Use sanitizers:    ${enabled_sanitizers:=no}
   Messages:          ${enable_messages}

-- 
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]