2
1

0016-Add-an-option-to-disable-installation-of-test-module.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. From 0eac7789c0dd4aebe9e69d3c73d0c95e96922ea3 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 7 Mar 2017 22:27:16 +0100
  4. Subject: [PATCH] Add an option to disable installation of test modules
  5. The Python standard distribution comes with many test modules, that
  6. are not necessarly useful on embedded targets.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  9. [Bernd: rebased against version 2.7.14]
  10. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  11. ---
  12. Makefile.pre.in | 48 ++++++++++++++++++++++++++++++++----------------
  13. configure.ac | 6 ++++++
  14. 2 files changed, 38 insertions(+), 16 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index dedcf61..280cc4e 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1032,28 +1032,44 @@
  20. plat-mac/lib-scriptpackages/SystemEvents \
  21. plat-mac/lib-scriptpackages/Terminal
  22. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  23. -LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
  24. - lib-tk/test/test_ttk site-packages test test/audiodata test/capath \
  25. - test/data test/cjkencodings test/decimaltestdata test/xmltestdata \
  26. - test/imghdrdata \
  27. - test/subprocessdata \
  28. - test/support \
  29. - test/tracedmodules \
  30. +LIBSUBDIRS= lib-tk site-packages \
  31. encodings compiler hotshot \
  32. - email email/mime email/test email/test/data \
  33. + email email/mime \
  34. ensurepip ensurepip/_bundled \
  35. - json json/tests \
  36. - sqlite3 sqlite3/test \
  37. - logging bsddb bsddb/test csv importlib wsgiref \
  38. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  39. - lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  40. - ctypes ctypes/test ctypes/macholib \
  41. - idlelib idlelib/Icons idlelib/idle_test \
  42. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  43. + json \
  44. + sqlite3 \
  45. + logging bsddb csv importlib wsgiref \
  46. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  47. + ctypes ctypes/macholib \
  48. + idlelib idlelib/Icons \
  49. + distutils distutils/command $(XMLLIBSUBDIRS) \
  50. multiprocessing multiprocessing/dummy \
  51. - unittest unittest/test \
  52. + unittest \
  53. lib-old \
  54. curses pydoc_data $(MACHDEPS)
  55. +
  56. +TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  57. + lib-tk/test/test_ttk test test/audiodata test/capath test/data \
  58. + test/cjkencodings test/decimaltestdata test/xmltestdata \
  59. + test/imghdrdata \
  60. + test/subprocessdata \
  61. + test/support \
  62. + test/tracedmodules \
  63. + email/test email/test/data \
  64. + json/tests \
  65. + sqlite3/test \
  66. + bsddb/test \
  67. + lib2to3/tests \
  68. + lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  69. + ctypes/test \
  70. + idlelib/idle_test \
  71. + distutils/tests \
  72. + unittest/test
  73. +
  74. +ifeq (@TEST_MODULES@,yes)
  75. +LIBSUBDIRS += $(TESTSUBDIRS)
  76. +endif
  77. +
  78. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  79. @for i in $(SCRIPTDIR) $(LIBDEST); \
  80. do \
  81. diff --git a/configure.ac b/configure.ac
  82. index 183a903..a1a35f6 100644
  83. --- a/configure.ac
  84. +++ b/configure.ac
  85. @@ -2806,6 +2806,12 @@ if test "$posix_threads" = "yes"; then
  86. fi
  87. +AC_SUBST(TEST_MODULES)
  88. +
  89. +AC_ARG_ENABLE(test-modules,
  90. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  91. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  92. +
  93. # Check for enable-ipv6
  94. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  95. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  96. --
  97. 2.7.4