1From ad6b66b34f71ff6b60b3be5f6fd3e781cdeecd59 Mon Sep 17 00:00:00 2001 2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 3Date: Wed, 22 Feb 2017 17:23:42 -0800 4Subject: [PATCH] Add an option to disable the tk module 5 6Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 7Signed-off-by: Samuel Martin <s.martin49@gmail.com> 8[ Andrey Smirnov: ported to Python 3.6 ] 9Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> 10[ Adam Duskett: ported to Python 3.10.0 ] 11Signed-off-by: Adam Duskett <aduskett@gmail.com> 12--- 13 Makefile.pre.in | 10 +++++++--- 14 configure.ac | 9 +++++++++ 15 2 files changed, 16 insertions(+), 3 deletions(-) 16 17diff --git a/Makefile.pre.in b/Makefile.pre.in 18index 5628860..c968113 100644 19--- a/Makefile.pre.in 20+++ b/Makefile.pre.in 21@@ -1446,7 +1446,6 @@ LIBSUBDIRS= asyncio \ 22 logging \ 23 multiprocessing multiprocessing/dummy \ 24 site-packages \ 25- tkinter \ 26 turtledemo \ 27 unittest \ 28 urllib \ 29@@ -1522,8 +1521,6 @@ TESTSUBDIRS= ctypes/test \ 30 test/tracedmodules \ 31 test/xmltestdata test/xmltestdata/c14n-20 \ 32 test/ziptestdata \ 33- tkinter/test tkinter/test/test_tkinter \ 34- tkinter/test/test_ttk \ 35 unittest/test unittest/test/testmock 36 37 ifeq (@PYDOC@,yes) 38@@ -1543,6 +1540,13 @@ LIBSUBDIRS += sqlite3 39 TESTSUBDIRS += sqlite3/test 40 endif 41 42+ifeq (@TK@,yes) 43+LIBSUBDIRS += tkinter 44+TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ 45+ tkinter/test/test_ttk 46+endif 47+ 48+ 49 TEST_MODULES=@TEST_MODULES@ 50 libinstall: build_all $(srcdir)/Modules/xxmodule.c 51 @for i in $(SCRIPTDIR) $(LIBDEST); \ 52diff --git a/configure.ac b/configure.ac 53index dfee472..dc76dff 100644 54--- a/configure.ac 55+++ b/configure.ac 56@@ -3382,6 +3382,15 @@ if test "$SQLITE3" = "no" ; then 57 DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" 58 fi 59 60+AC_SUBST(TK) 61+AC_ARG_ENABLE(tk, 62+ AS_HELP_STRING([--disable-tk], [disable tk]), 63+ [ TK="${enableval}" ], [ TK=yes ]) 64+ 65+if test "$TK" = "no"; then 66+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" 67+fi 68+ 69 AC_SUBST(PYDOC) 70 71 AC_ARG_ENABLE(pydoc, 72-- 732.30.2 74 75