0019-Add-option-to-disable-the-sqlite3-module.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 123ecc50932e3ad3f7a2d90d430b74822c9695d4 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 7 Mar 2017 22:28:06 +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. [Peter: update for 2.7.16]
  8. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  9. ---
  10. Makefile.pre.in | 7 +++++--
  11. configure.ac | 9 +++++++++
  12. 2 files changed, 14 insertions(+), 2 deletions(-)
  13. diff --git a/Makefile.pre.in b/Makefile.pre.in
  14. index 0e15b6d6f4..a2e5ac6d41 100644
  15. --- a/Makefile.pre.in
  16. +++ b/Makefile.pre.in
  17. @@ -1053,7 +1053,6 @@ LIBSUBDIRS= lib-tk site-packages \
  18. email email/mime \
  19. ensurepip ensurepip/_bundled \
  20. json \
  21. - sqlite3 \
  22. logging bsddb csv importlib wsgiref \
  23. ctypes ctypes/macholib \
  24. idlelib idlelib/Icons \
  25. @@ -1072,7 +1071,6 @@ TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  26. test/tracedmodules \
  27. email/test email/test/data \
  28. json/tests \
  29. - sqlite3/test \
  30. bsddb/test \
  31. ctypes/test \
  32. idlelib/idle_test \
  33. @@ -1095,6 +1093,11 @@ TESTSUBDIRS += lib2to3/tests \
  34. lib2to3/tests/data/fixers/myfixes
  35. endif
  36. +ifeq (@SQLITE3@,yes)
  37. +LIBSUBDIRS += sqlite3
  38. +TESTSUBDIRS += sqlite3/test
  39. +endif
  40. +
  41. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  42. @for i in $(SCRIPTDIR) $(LIBDEST); \
  43. do \
  44. diff --git a/configure.ac b/configure.ac
  45. index a2810ab8ed..4ee3c60501 100644
  46. --- a/configure.ac
  47. +++ b/configure.ac
  48. @@ -2834,6 +2834,15 @@ if test "$posix_threads" = "yes"; then
  49. AC_CHECK_FUNCS(pthread_atfork)
  50. fi
  51. +AC_SUBST(SQLITE3)
  52. +AC_ARG_ENABLE(sqlite3,
  53. + AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]),
  54. + [ SQLITE3="${enableval}" ], [ SQLITE3=yes ])
  55. +
  56. +if test "$SQLITE3" = "no" ; then
  57. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  58. +fi
  59. +
  60. AC_SUBST(PYDOC)
  61. AC_ARG_ENABLE(pydoc,
  62. --
  63. 2.11.0