0002-configure.ac-add-an-option-to-disable-tests.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. ---
  15. Makefile.am | 7 ++++++-
  16. configure.ac | 10 ++++++++++
  17. 2 files changed, 16 insertions(+), 1 deletion(-)
  18. diff --git a/Makefile.am b/Makefile.am
  19. index 7fa4fa4d..f0bd90e4 100644
  20. --- a/Makefile.am
  21. +++ b/Makefile.am
  22. @@ -39,9 +39,14 @@ else
  23. doc =
  24. endif
  25. +if BUILD_TESTS
  26. +tests = tests
  27. +else
  28. +tests =
  29. +endif
  30. DIST_SUBDIRS = m4 compat mpi cipher random src doc tests
  31. -SUBDIRS = compat mpi cipher random src $(doc) tests
  32. +SUBDIRS = compat mpi cipher random src $(doc) $(tests)
  33. EXTRA_DIST = autogen.sh autogen.rc README.GIT LICENSES \
  34. ChangeLog-2011 build-aux/ChangeLog-2011 doc/ChangeLog-2011 \
  35. diff --git a/configure.ac b/configure.ac
  36. index e8c8cd39..1a6b61e5 100644
  37. --- a/configure.ac
  38. +++ b/configure.ac
  39. @@ -2710,6 +2710,16 @@ AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
  40. AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
  41. +#
  42. +# Option to disable building of tests
  43. +#
  44. +build_tests=yes
  45. +AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],
  46. + [do not build tests]),
  47. + build_tests=$enableval, build_tests=yes)
  48. +AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != xno])
  49. +
  50. +
  51. #
  52. # Provide information about the build.
  53. #
  54. --
  55. 2.20.1