1From 962deb43f5f340a8472d432ae8e6d61186f9040e Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3Date: Wed, 22 Feb 2017 17:31:51 -0800
4Subject: [PATCH] Add an option to disable the curses 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 |  4 +++-
14 configure.ac    | 9 +++++++++
15 2 files changed, 12 insertions(+), 1 deletion(-)
16
17diff --git a/Makefile.pre.in b/Makefile.pre.in
18index c968113..f89f155 100644
19--- a/Makefile.pre.in
20+++ b/Makefile.pre.in
21@@ -1432,7 +1432,6 @@ LIBSUBDIRS=	asyncio \
22 		concurrent concurrent/futures \
23 		csv \
24 		ctypes ctypes/macholib \
25-		curses \
26 		dbm \
27 		distutils distutils/command \
28 		email email/mime \
29@@ -1546,6 +1545,9 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
30 	tkinter/test/test_ttk
31 endif
32
33+ifeq (@CURSES@,yes)
34+LIBSUBDIRS += curses
35+endif
36
37 TEST_MODULES=@TEST_MODULES@
38 libinstall:	build_all $(srcdir)/Modules/xxmodule.c
39diff --git a/configure.ac b/configure.ac
40index dc76dff..4f1cda5 100644
41--- a/configure.ac
42+++ b/configure.ac
43@@ -3391,6 +3391,15 @@ if test "$TK" = "no"; then
44    DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
45 fi
46
47+AC_SUBST(CURSES)
48+AC_ARG_ENABLE(curses,
49+	AS_HELP_STRING([--disable-curses], [disable curses]),
50+	[ CURSES="${enableval}" ], [ CURSES=yes ])
51+
52+if test "$CURSES" = "no"; then
53+   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel"
54+fi
55+
56 AC_SUBST(PYDOC)
57
58 AC_ARG_ENABLE(pydoc,
59--
602.30.2
61
62