0003-configure.ac-add-disable-werror.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From 8497f7ed38146378a988bc22800b3a5eba38b0fd Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 13 Jun 2022 16:29:38 +0200
  4. Subject: [PATCH] configure.ac: add --disable-werror
  5. Allow the user to disable -Werror to avoid the following build failure:
  6. In file included from hash.c:7:
  7. xxhash.h:2667:5: error: #warning is a GCC extension [-Werror]
  8. 2667 | # warning "XXH3 is highly inefficient without ARM or Thumb-2."
  9. | ^~~~~~~
  10. xxhash.h:2667:5: error: #warning "XXH3 is highly inefficient without ARM or Thumb-2." [-Werror=cpp]
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/3124bae73c207f1a118e57e41e222ef464ccb297
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/memcached/memcached/pull/926]
  15. ---
  16. configure.ac | 11 +++++++++--
  17. 1 file changed, 9 insertions(+), 2 deletions(-)
  18. diff --git a/configure.ac b/configure.ac
  19. index 3337fe7..7683b8f 100644
  20. --- a/configure.ac
  21. +++ b/configure.ac
  22. @@ -114,6 +114,9 @@ AC_ARG_ENABLE(static,
  23. AC_ARG_ENABLE(unix_socket,
  24. [AS_HELP_STRING([--disable-unix-socket], [Disable unix domain socket])])
  25. +AC_ARG_ENABLE(werror,
  26. + [AS_HELP_STRING([--disable-werror], [Disable -Werror])])
  27. +
  28. dnl **********************************************************************
  29. dnl DETECT_SASL_CB_GETCONF
  30. dnl
  31. @@ -783,6 +786,10 @@ AM_CONDITIONAL([BUILD_SPECIFICATIONS],
  32. [test "x$enable_docs" != "xno" -a "x$XML2RFC" != "xno" -a "x$XSLTPROC" != "xno"])
  33. +if test "x$enable_werror" != "xno"; then
  34. + CFLAGS="$CFLAGS -Werror"
  35. +fi
  36. +
  37. dnl Let the compiler be a bit more picky. Please note that you cannot
  38. dnl specify these flags to the compiler before AC_CHECK_FUNCS, because
  39. dnl the test program will generate a compilation warning and hence fail
  40. @@ -790,12 +797,12 @@ dnl to detect the function ;-)
  41. if test "$ICC" = "yes"
  42. then
  43. dnl ICC trying to be gcc.
  44. - CFLAGS="$CFLAGS -diag-disable 187 -Wall -Werror"
  45. + CFLAGS="$CFLAGS -diag-disable 187 -Wall"
  46. AC_DEFINE([_GNU_SOURCE],[1],[make sure IOV_MAX is defined])
  47. elif test "$GCC" = "yes"
  48. then
  49. GCC_VERSION=`$CC -dumpversion`
  50. - CFLAGS="$CFLAGS -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls"
  51. + CFLAGS="$CFLAGS -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls"
  52. if test "x$enable_asan" = "xyes"; then
  53. CFLAGS="$CFLAGS -fsanitize=address"
  54. fi
  55. --
  56. 2.35.1