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
6 The Python standard distribution comes with many test modules, that
7 are not necessarly useful on embedded targets.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
12 Makefile.pre.in | 48 ++++++++++++++++++++++++++++++++----------------
13 configure.ac | 6 ++++++
14 2 files changed, 38 insertions(+), 16 deletions(-)
16 diff --git a/Makefile.pre.in b/Makefile.pre.in
17 index dedcf61..280cc4e 100644
20 @@ -1038,27 +1038,43 @@ PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
21 plat-mac/lib-scriptpackages/SystemEvents \
22 plat-mac/lib-scriptpackages/Terminal
23 PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
24 -LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
25 - lib-tk/test/test_ttk site-packages test test/audiodata test/capath \
26 - test/data test/cjkencodings test/decimaltestdata test/xmltestdata \
28 - test/subprocessdata \
29 - test/tracedmodules \
30 +LIBSUBDIRS= lib-tk site-packages \
31 encodings compiler hotshot \
32 - email email/mime email/test email/test/data \
34 ensurepip ensurepip/_bundled \
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) \
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 \
54 curses pydoc_data $(MACHDEPS)
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 \
60 + test/subprocessdata \
61 + test/tracedmodules \
62 + email/test email/test/data \
67 + lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
73 +ifeq (@TEST_MODULES@,yes)
74 +LIBSUBDIRS += $(TESTSUBDIRS)
77 libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
78 @for i in $(SCRIPTDIR) $(LIBDEST); \
80 diff --git a/configure.ac b/configure.ac
81 index 183a903..a1a35f6 100644
84 @@ -2806,6 +2806,12 @@ if test "$posix_threads" = "yes"; then
88 +AC_SUBST(TEST_MODULES)
90 +AC_ARG_ENABLE(test-modules,
91 + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
92 + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
94 # Check for enable-ipv6
95 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
96 AC_MSG_CHECKING([if --enable-ipv6 is specified])