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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From f2965dfb1aa4f6b3216f3bb1d20f99326f127079 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. [aduskett@gmail.com: Update for python 3.6.4]
  10. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  11. ---
  12. Makefile.pre.in | 7 +++++--
  13. configure.ac | 9 +++++++++
  14. 2 files changed, 14 insertions(+), 2 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index 931cc3ed07..a1ce0712cd 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1237,7 +1237,6 @@ LIBSUBDIRS= tkinter site-packages \
  20. email email/mime \
  21. ensurepip ensurepip/_bundled \
  22. html json http dbm xmlrpc \
  23. - sqlite3 \
  24. logging csv wsgiref urllib \
  25. ctypes ctypes/macholib \
  26. idlelib idlelib/Icons \
  27. @@ -1289,7 +1289,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  28. test/test_asyncio \
  29. test/test_email test/test_email/data \
  30. test/test_json \
  31. - sqlite3/test \
  32. ctypes/test \
  33. idlelib/idle_test \
  34. distutils/tests \
  35. @@ -1307,6 +1305,11 @@ TESTSUBDIRS += lib2to3/tests \
  36. lib2to3/tests/data/fixers/myfixes
  37. endif
  38. +ifeq (@SQLITE3@,yes)
  39. +LIBSUBDIRS += sqlite3
  40. +TESTSUBDIRS += sqlite3/test
  41. +endif
  42. +
  43. ifeq (@TEST_MODULES@,yes)
  44. LIBSUBDIRS += $(TESTSUBDIRS)
  45. endif
  46. diff --git a/configure.ac b/configure.ac
  47. index 13b2edf8b7..d7582cfea4 100644
  48. --- a/configure.ac
  49. +++ b/configure.ac
  50. @@ -3112,6 +3112,15 @@ if test "$posix_threads" = "yes"; then
  51. AC_CHECK_FUNCS(pthread_atfork)
  52. fi
  53. +AC_SUBST(SQLITE3)
  54. +AC_ARG_ENABLE(sqlite3,
  55. + AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]),
  56. + [ SQLITE3="${enableval}" ], [ SQLITE3=yes ])
  57. +
  58. +if test "$SQLITE3" = "no" ; then
  59. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  60. +fi
  61. +
  62. AC_SUBST(PYDOC)
  63. AC_ARG_ENABLE(pydoc,
  64. --
  65. 2.13.5