2
1

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. From 2c1810fb002128a6d33cc3a391a157e316479d15 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. [Peter: update for 2.7.16]
  12. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  13. ---
  14. Makefile.pre.in | 50 +++++++++++++++++++++++++++++++++-----------------
  15. configure.ac | 6 ++++++
  16. 2 files changed, 39 insertions(+), 17 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index 37b2ff3a5f..2a5e8adc61 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1048,28 +1048,44 @@ PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
  22. plat-mac/lib-scriptpackages/SystemEvents \
  23. plat-mac/lib-scriptpackages/Terminal
  24. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  25. -LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
  26. - lib-tk/test/test_ttk site-packages test test/audiodata test/capath \
  27. - test/data test/cjkencodings test/decimaltestdata test/xmltestdata \
  28. - test/imghdrdata \
  29. - test/subprocessdata \
  30. - test/support \
  31. - test/tracedmodules \
  32. +LIBSUBDIRS= lib-tk site-packages \
  33. encodings compiler hotshot \
  34. - email email/mime email/test email/test/data \
  35. + email email/mime \
  36. ensurepip ensurepip/_bundled \
  37. - json json/tests \
  38. - sqlite3 sqlite3/test \
  39. - logging bsddb bsddb/test csv importlib wsgiref \
  40. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  41. - lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  42. - ctypes ctypes/test ctypes/macholib \
  43. - idlelib idlelib/Icons idlelib/idle_test \
  44. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  45. + json \
  46. + sqlite3 \
  47. + logging bsddb csv importlib wsgiref \
  48. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  49. + ctypes ctypes/macholib \
  50. + idlelib idlelib/Icons \
  51. + distutils distutils/command $(XMLLIBSUBDIRS) \
  52. multiprocessing multiprocessing/dummy \
  53. - unittest unittest/test \
  54. + unittest \
  55. lib-old \
  56. curses pydoc_data $(MACHDEPS)
  57. +
  58. +TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  59. + lib-tk/test/test_ttk test test/audiodata test/capath test/data \
  60. + test/cjkencodings test/decimaltestdata test/xmltestdata \
  61. + test/imghdrdata \
  62. + test/subprocessdata \
  63. + test/support \
  64. + test/tracedmodules \
  65. + email/test email/test/data \
  66. + json/tests \
  67. + sqlite3/test \
  68. + bsddb/test \
  69. + lib2to3/tests \
  70. + lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  71. + ctypes/test \
  72. + idlelib/idle_test \
  73. + distutils/tests \
  74. + unittest/test
  75. +
  76. +ifeq (@TEST_MODULES@,yes)
  77. +LIBSUBDIRS += $(TESTSUBDIRS)
  78. +endif
  79. +
  80. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  81. @for i in $(SCRIPTDIR) $(LIBDEST); \
  82. do \
  83. diff --git a/configure.ac b/configure.ac
  84. index 3f28ef1371..f257a25620 100644
  85. --- a/configure.ac
  86. +++ b/configure.ac
  87. @@ -2835,6 +2835,12 @@ if test "$posix_threads" = "yes"; then
  88. fi
  89. +AC_SUBST(TEST_MODULES)
  90. +
  91. +AC_ARG_ENABLE(test-modules,
  92. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  93. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  94. +
  95. # Check for enable-ipv6
  96. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  97. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  98. --
  99. 2.11.0