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

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