0007-Add-option-to-disable-the-sqlite3-module.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From a8566f6ee2a2b859ba5562f2d9f06cb4d271f277 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Tue, 6 Feb 2024 22:12:20 +0100
  4. Subject: [PATCH] Add option to disable the sqlite3 module
  5. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  6. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  7. [ Andrey Smirnov: ported to Python 3.6 ]
  8. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  9. [ Adam Duskett: ported to Python 3.10.0 ]
  10. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  12. ---
  13. Makefile.pre.in | 5 ++++-
  14. configure.ac | 7 +++++++
  15. 2 files changed, 11 insertions(+), 1 deletion(-)
  16. diff --git a/Makefile.pre.in b/Makefile.pre.in
  17. index 5fad7f82fb..7b6c9811a6 100644
  18. --- a/Makefile.pre.in
  19. +++ b/Makefile.pre.in
  20. @@ -2108,7 +2108,6 @@ LIBSUBDIRS= asyncio \
  21. multiprocessing multiprocessing/dummy \
  22. re \
  23. site-packages \
  24. - sqlite3 \
  25. tkinter \
  26. tomllib \
  27. turtledemo \
  28. @@ -2272,6 +2271,10 @@ ifeq (@IDLE@,yes)
  29. LIBSUBDIRS += idlelib idlelib/Icons
  30. endif
  31. +ifeq (@SQLITE3@,yes)
  32. +LIBSUBDIRS += sqlite3
  33. +endif
  34. +
  35. TEST_MODULES=@TEST_MODULES@
  36. .PHONY: libinstall
  37. diff --git a/configure.ac b/configure.ac
  38. index 561e33f550..d1c54bd67c 100644
  39. --- a/configure.ac
  40. +++ b/configure.ac
  41. @@ -4516,6 +4516,13 @@ AS_VAR_IF([posix_threads], [stub], [
  42. AC_DEFINE([HAVE_PTHREAD_STUBS], [1], [Define if platform requires stubbed pthreads support])
  43. ])
  44. +AC_SUBST(SQLITE3)
  45. +AC_ARG_ENABLE(sqlite3,
  46. + AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]),
  47. + [ SQLITE3="${enableval}" ], [ SQLITE3=yes ])
  48. +AS_IF([test "$SQLITE3" = "no"],
  49. + [PY_STDLIB_MOD_SET_NA([_sqlite3])])
  50. +
  51. AC_SUBST(PYDOC)
  52. AC_ARG_ENABLE(pydoc,
  53. --
  54. 2.34.1