python-2.7-103-optional-sqlite.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Add option to disable the sqlite3 module
  2. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  4. ---
  5. Makefile.pre.in | 24 +++++++++++++++++-------
  6. configure.in | 9 +++++++++
  7. 2 file changed, 9 insertions(+)
  8. Index: Python-2.7.2/configure.in
  9. ===================================================================
  10. --- Python-2.7.2.orig/configure.in
  11. +++ Python-2.7.2/configure.in
  12. @@ -2407,6 +2407,15 @@
  13. esac])
  14. fi
  15. +AC_SUBST(SQLITE3)
  16. +AC_ARG_ENABLE(sqlite3,
  17. + AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]),
  18. + [ SQLITE3="${enableval}" ], [ SQLITE3=yes ])
  19. +
  20. +if test "$SQLITE3" = "no" ; then
  21. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  22. +fi
  23. +
  24. AC_SUBST(PYDOC)
  25. AC_ARG_ENABLE(pydoc,
  26. Index: Python-2.7.2/Makefile.pre.in
  27. ===================================================================
  28. --- Python-2.7.2.orig/Makefile.pre.in
  29. +++ Python-2.7.2/Makefile.pre.in
  30. @@ -875,7 +874,7 @@
  31. lib-tk/test/test_ttk test test/data \
  32. test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  33. test/tracedmodules email/test email/test/data \
  34. - json/tests sqlite3/test bsddb/test \
  35. + json/tests bsddb/test \
  36. ctypes/test distutils/tests unittest/test
  37. endif
  38. @@ -884,6 +882,13 @@
  39. LIBSUBDIRS += pydoc_data
  40. endif
  41. +ifeq (@SQLITE3@,yes)
  42. +LIBSUBDIRS += sqlite3
  43. +ifeq (@TEST_MODULES@,yes)
  44. +LIBSUBDIRS += sqlite3/test
  45. +endif
  46. +endif
  47. +
  48. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  49. @for i in $(SCRIPTDIR) $(LIBDEST); \
  50. do \