0001-configure.ac-add-an-option-to-disable-tests.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 7fe1b8a53cc8c865c2a10dcd8f6cb4e51ccc6300 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 29 Jul 2019 12:19:10 +0200
  4. Subject: [PATCH] configure.ac: add an option to disable tests
  5. Add an option to allow the user to disable tests, this can be useful for
  6. example when the toolchain does not provide thread. Indeed, in this
  7. case, libgcrypt fails to build t-lock:
  8. t-lock.c: In function 'run_test':
  9. t-lock.c:359:3: error: unknown type name 'pthread_t'
  10. pthread_t rthread;
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/50a8ba572e3fafd3c6a39bd54bcfcaf78b5ad325
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Bernd: rebased for version 1.11.0]
  15. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  16. ---
  17. Makefile.am | 7 ++++++-
  18. configure.ac | 10 ++++++++++
  19. 2 files changed, 16 insertions(+), 1 deletion(-)
  20. diff --git a/Makefile.am b/Makefile.am
  21. index 7fa4fa4d..f0bd90e4 100644
  22. --- a/Makefile.am
  23. +++ b/Makefile.am
  24. @@ -40,9 +40,14 @@ else
  25. doc =
  26. endif
  27. +if BUILD_TESTS
  28. +tests = tests
  29. +else
  30. +tests =
  31. +endif
  32. DIST_SUBDIRS = m4 compat mpi cipher random src doc tests
  33. -SUBDIRS = compat mpi cipher random src $(doc) tests
  34. +SUBDIRS = compat mpi cipher random src $(doc) $(tests)
  35. EXTRA_DIST = autogen.sh autogen.rc README.GIT LICENSES \
  36. ChangeLog-2011 build-aux/ChangeLog-2011 doc/ChangeLog-2011 \
  37. diff --git a/configure.ac b/configure.ac
  38. index e8c8cd39..1a6b61e5 100644
  39. --- a/configure.ac
  40. +++ b/configure.ac
  41. @@ -3777,6 +3777,16 @@ AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
  42. AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
  43. +#
  44. +# Option to disable building of tests
  45. +#
  46. +build_tests=yes
  47. +AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],
  48. + [do not build tests]),
  49. + build_tests=$enableval, build_tests=yes)
  50. +AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != xno])
  51. +
  52. +
  53. #
  54. # Provide information about the build.
  55. #
  56. --
  57. 2.20.1