1 Add an option to disable lib2to3
3 lib2to3 is a library to convert Python 2.x code to Python 3.x. As
4 such, it is probably not very useful on embedded system targets.
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
10 Makefile.pre.in | 18 ++++++++++++++----
11 configure.ac | 6 ++++++
13 3 files changed, 23 insertions(+), 6 deletions(-)
15 Index: b/Makefile.pre.in
16 ===================================================================
20 (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
22 -rm -f $(DESTDIR)$(BINDIR)/2to3
24 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
26 -rm -f $(DESTDIR)$(BINDIR)/pyvenv
27 (cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv)
28 if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
30 html json http dbm xmlrpc \
32 logging csv wsgiref urllib \
33 - lib2to3 lib2to3/fixes lib2to3/pgen2 \
34 ctypes ctypes/macholib \
35 idlelib idlelib/Icons \
36 distutils distutils/command $(XMLLIBSUBDIRS) \
38 test/test_importlib/namespace_pkgs/module_and_namespace_package \
39 test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
42 - lib2to3/tests/data lib2to3/tests/data/fixers \
43 - lib2to3/tests/data/fixers/myfixes \
47 @@ -1204,6 +1202,14 @@
48 LIBSUBDIRS += pydoc_data
52 +LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
53 +TESTSUBDIRS += lib2to3/tests \
54 + lib2to3/tests/data \
55 + lib2to3/tests/data/fixers \
56 + lib2to3/tests/data/fixers/myfixes
59 ifeq (@TEST_MODULES@,yes)
60 LIBSUBDIRS += $(TESTSUBDIRS)
62 @@ -1299,10 +1305,12 @@
63 -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
64 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
67 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
68 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
69 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
70 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
73 # Create the PLATDIR source directory, if one wasn't distributed..
74 $(srcdir)/Lib/$(PLATDIR):
76 ===================================================================
79 @@ -2201,10 +2201,11 @@
81 warnings.filterwarnings("ignore",category=DeprecationWarning)
83 - scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3',
85 + scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
86 if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
87 scripts += [ 'Tools/scripts/pydoc3' ]
88 + if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
89 + scripts += [ 'Tools/scripts/2to3' ]
91 setup(# PyPI Metadata (PEP 301)
94 ===================================================================
97 @@ -2687,6 +2687,12 @@
98 AS_HELP_STRING([--disable-test-modules], [disable test modules]),
99 [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
103 +AC_ARG_ENABLE(lib2to3,
104 + AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
105 + [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
107 # Check for enable-ipv6
108 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
109 AC_MSG_CHECKING([if --enable-ipv6 is specified])