0002-Add-disable-werror.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From c27b154f03ad7e94447c7114d73aee60f0098093 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 7 Nov 2022 13:38:06 +0100
  4. Subject: [PATCH] Add --disable-werror
  5. Allow the user to disable -Werror through --disable-werror
  6. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  7. Signed-off-by: Stephan Mueller <smueller@chronox.de>
  8. [Retrieved from:
  9. https://github.com/smuellerDD/libkcapi/commit/c27b154f03ad7e94447c7114d73aee60f0098093]
  10. ---
  11. Makefile.am | 5 ++++-
  12. configure.ac | 3 +++
  13. 2 files changed, 7 insertions(+), 1 deletion(-)
  14. diff --git a/Makefile.am b/Makefile.am
  15. index 1c95d3d..cddedac 100644
  16. --- a/Makefile.am
  17. +++ b/Makefile.am
  18. @@ -2,7 +2,10 @@ ACLOCAL_AMFLAGS = -I m4
  19. AUTOMAKE_OPTIONS = subdir-objects
  20. lib_LTLIBRARIES = libkcapi.la
  21. -COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param ssp-buffer-size=4 -O2 -Werror -std=gnu99 -Wconversion
  22. +COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param ssp-buffer-size=4 -O2 -std=gnu99 -Wconversion
  23. +if ENABLE_WERROR
  24. +COMMON_CPPFLAGS += -Werror
  25. +endif
  26. COMMON_LDFLAGS = -Wl,-z,relro,-z,now
  27. libtool: $(LIBTOOL_DEPS)
  28. diff --git a/configure.ac b/configure.ac
  29. index cb910e2..e230577 100644
  30. --- a/configure.ac
  31. +++ b/configure.ac
  32. @@ -76,6 +76,9 @@ AX_ADD_FORTIFY_SOURCE
  33. AC_CHECK_API_VERSION
  34. +AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], [Disable -Werror])], [with_werror=$enableval], [with_werror=yes])
  35. +AM_CONDITIONAL([ENABLE_WERROR], [test "x$with_werror" = "xyes"])
  36. +
  37. AC_ARG_ENABLE([kcapi-test], [AS_HELP_STRING([--enable-kcapi-test], [Compile kcapi test program])], [with_kcapi_test=$enableval])
  38. AM_CONDITIONAL([ENABLE_KCAPI_TEST], [test "x$with_kcapi_test" = "xyes"])