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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 1a1d13a973d9dcbd6660bfef40cf35c7638f779b Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 17:20:45 -0800
  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. ---
  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 3e1f130532..cf9add0bc7 100644
  15. --- a/Makefile.pre.in
  16. +++ b/Makefile.pre.in
  17. @@ -1328,7 +1328,6 @@ LIBSUBDIRS= tkinter site-packages \
  18. email email/mime \
  19. ensurepip ensurepip/_bundled \
  20. html json http dbm xmlrpc \
  21. - sqlite3 \
  22. logging csv wsgiref urllib \
  23. ctypes ctypes/macholib \
  24. idlelib idlelib/Icons \
  25. @@ -1402,7 +1401,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  26. test/test_asyncio \
  27. test/test_email test/test_email/data \
  28. test/test_json \
  29. - sqlite3/test \
  30. ctypes/test \
  31. idlelib/idle_test \
  32. distutils/tests \
  33. @@ -1418,6 +1416,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. ifeq (@TEST_MODULES@,yes)
  42. LIBSUBDIRS += $(TESTSUBDIRS)
  43. endif
  44. diff --git a/configure.ac b/configure.ac
  45. index caa8eaf88a..79a8255f44 100644
  46. --- a/configure.ac
  47. +++ b/configure.ac
  48. @@ -3213,6 +3213,15 @@ if test "$posix_threads" = "yes"; then
  49. AC_CHECK_FUNCS(pthread_getcpuclockid)
  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.20.1