2017-03-08 00:00:26 +01:00
|
|
|
From 570e1e81484d9bcbd30a7719b07d02785a5cab24 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
Date: Tue, 7 Mar 2017 22:28:06 +0100
|
|
|
|
Subject: [PATCH] Add option to disable the sqlite3 module
|
python: convert to autotargets, bump to 2.7.1, many improvements
This commit does a number of changes and improvements to the Python
interpreter package :
* It converts the .mk file to the AUTOTARGETS infrastructure. Even
though Python uses only autoconf and not automake, the AUTOTARGETS
is a fairly good fit for the Python interpreter, so we make use of
it.
* It bumps the version to 2.7.1. As this is a minor release compared
to 2.7, there are no particular changes needed because of this
bump. All changes done to the package are cleanups and improvements
unrelated to the version bump.
* It uses the system libffi. Until now, Python was building its own
libffi (a library used by interprets to build code that makes
function call at runtime). Using the Python internal libffi was not
working as Python was not passing the appropriate arguments down to
libffi ./configure script. And it sounded better to use a
system-wide libffi, that could potentially be used by other
packages as well. This libffi is needed for the ctypes Python
module.
* Remove all "depends on BR2_PACKAGE_PYTHON" by moving all
Python-related options under a "if BR2_PACKAGE_PYTHON ... endif"
condition.
* Make the installation of pre-compiled Python modules (.pyc) the
default, since they are smaller and do not need to be compiled on
the target. It is still possible to install uncompiled modules, or
both the uncompiled and pre-compiled versions.
* The options to select the set of Python modules to compile has been
moved to a submenu.
* The codecscjk (Japanese, Korean and Chinese codecs) module is no
longer enabled by default.
* The commented options for gdbm and nis in Python have been
removed. Those were not supported, so let's get rid of unused code.
* The option for the tkinker module in Python has been removed, since
we don't have a package for Tk in Buildroot.
* Options for the bzip2, sqlite and zlib modules have been added,
since those modules have external dependencies.
* The set of patches has been completely reworked and extended, with
more fine-grained patches and newer functionalities. The patches
are split in two categories:
- Patches that make various modifications to the Python build
system to support cross-compilation or make some minor
modifications. Those patches are numbered from 0 to 100.
- Patches that add configuration options to the Python build
system in order to enable/disable the compilation of Python
extensions or modules (test modules, pydoc, lib2to3, sqlite, tk,
curses, expat, codecs-cjk, nis, unicodedata, database modules,
ssl, bzip2, zlib). These patches are numbered from 100 to 200.
All features of the previous four patches are preserved, but they
are organized differently and the patches have been renamed. This
makes it difficult to see the differences from the existing
patches.
* The host Python interpreter is now installed in $(HOST_DIR), since
it is used to build third party Python modules.
* The BR2_PACKAGE_PYTHON_DEV option is removed since
BR2_HAVE_DEVFILES already does the necessary work.
* The "make -i install" workaround introduced by Maxime Ripard is no
longer needed. It was caused by the compilation of the tests that
required the unicodedata module (which wasn't built in the host
Python interpreter). Since we no longer compile the Python tests,
the problem doesn't exist anymore and we can avoid this "-i"
option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-12-26 10:28:49 +01:00
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
2012-11-30 12:46:27 +01:00
|
|
|
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
python: convert to autotargets, bump to 2.7.1, many improvements
This commit does a number of changes and improvements to the Python
interpreter package :
* It converts the .mk file to the AUTOTARGETS infrastructure. Even
though Python uses only autoconf and not automake, the AUTOTARGETS
is a fairly good fit for the Python interpreter, so we make use of
it.
* It bumps the version to 2.7.1. As this is a minor release compared
to 2.7, there are no particular changes needed because of this
bump. All changes done to the package are cleanups and improvements
unrelated to the version bump.
* It uses the system libffi. Until now, Python was building its own
libffi (a library used by interprets to build code that makes
function call at runtime). Using the Python internal libffi was not
working as Python was not passing the appropriate arguments down to
libffi ./configure script. And it sounded better to use a
system-wide libffi, that could potentially be used by other
packages as well. This libffi is needed for the ctypes Python
module.
* Remove all "depends on BR2_PACKAGE_PYTHON" by moving all
Python-related options under a "if BR2_PACKAGE_PYTHON ... endif"
condition.
* Make the installation of pre-compiled Python modules (.pyc) the
default, since they are smaller and do not need to be compiled on
the target. It is still possible to install uncompiled modules, or
both the uncompiled and pre-compiled versions.
* The options to select the set of Python modules to compile has been
moved to a submenu.
* The codecscjk (Japanese, Korean and Chinese codecs) module is no
longer enabled by default.
* The commented options for gdbm and nis in Python have been
removed. Those were not supported, so let's get rid of unused code.
* The option for the tkinker module in Python has been removed, since
we don't have a package for Tk in Buildroot.
* Options for the bzip2, sqlite and zlib modules have been added,
since those modules have external dependencies.
* The set of patches has been completely reworked and extended, with
more fine-grained patches and newer functionalities. The patches
are split in two categories:
- Patches that make various modifications to the Python build
system to support cross-compilation or make some minor
modifications. Those patches are numbered from 0 to 100.
- Patches that add configuration options to the Python build
system in order to enable/disable the compilation of Python
extensions or modules (test modules, pydoc, lib2to3, sqlite, tk,
curses, expat, codecs-cjk, nis, unicodedata, database modules,
ssl, bzip2, zlib). These patches are numbered from 100 to 200.
All features of the previous four patches are preserved, but they
are organized differently and the patches have been renamed. This
makes it difficult to see the differences from the existing
patches.
* The host Python interpreter is now installed in $(HOST_DIR), since
it is used to build third party Python modules.
* The BR2_PACKAGE_PYTHON_DEV option is removed since
BR2_HAVE_DEVFILES already does the necessary work.
* The "make -i install" workaround introduced by Maxime Ripard is no
longer needed. It was caused by the compilation of the tests that
required the unicodedata module (which wasn't built in the host
Python interpreter). Since we no longer compile the Python tests,
the problem doesn't exist anymore and we can avoid this "-i"
option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-12-26 10:28:49 +01:00
|
|
|
---
|
2017-03-08 00:00:26 +01:00
|
|
|
Makefile.pre.in | 7 +++++--
|
|
|
|
configure.ac | 9 +++++++++
|
|
|
|
2 files changed, 14 insertions(+), 2 deletions(-)
|
python: convert to autotargets, bump to 2.7.1, many improvements
This commit does a number of changes and improvements to the Python
interpreter package :
* It converts the .mk file to the AUTOTARGETS infrastructure. Even
though Python uses only autoconf and not automake, the AUTOTARGETS
is a fairly good fit for the Python interpreter, so we make use of
it.
* It bumps the version to 2.7.1. As this is a minor release compared
to 2.7, there are no particular changes needed because of this
bump. All changes done to the package are cleanups and improvements
unrelated to the version bump.
* It uses the system libffi. Until now, Python was building its own
libffi (a library used by interprets to build code that makes
function call at runtime). Using the Python internal libffi was not
working as Python was not passing the appropriate arguments down to
libffi ./configure script. And it sounded better to use a
system-wide libffi, that could potentially be used by other
packages as well. This libffi is needed for the ctypes Python
module.
* Remove all "depends on BR2_PACKAGE_PYTHON" by moving all
Python-related options under a "if BR2_PACKAGE_PYTHON ... endif"
condition.
* Make the installation of pre-compiled Python modules (.pyc) the
default, since they are smaller and do not need to be compiled on
the target. It is still possible to install uncompiled modules, or
both the uncompiled and pre-compiled versions.
* The options to select the set of Python modules to compile has been
moved to a submenu.
* The codecscjk (Japanese, Korean and Chinese codecs) module is no
longer enabled by default.
* The commented options for gdbm and nis in Python have been
removed. Those were not supported, so let's get rid of unused code.
* The option for the tkinker module in Python has been removed, since
we don't have a package for Tk in Buildroot.
* Options for the bzip2, sqlite and zlib modules have been added,
since those modules have external dependencies.
* The set of patches has been completely reworked and extended, with
more fine-grained patches and newer functionalities. The patches
are split in two categories:
- Patches that make various modifications to the Python build
system to support cross-compilation or make some minor
modifications. Those patches are numbered from 0 to 100.
- Patches that add configuration options to the Python build
system in order to enable/disable the compilation of Python
extensions or modules (test modules, pydoc, lib2to3, sqlite, tk,
curses, expat, codecs-cjk, nis, unicodedata, database modules,
ssl, bzip2, zlib). These patches are numbered from 100 to 200.
All features of the previous four patches are preserved, but they
are organized differently and the patches have been renamed. This
makes it difficult to see the differences from the existing
patches.
* The host Python interpreter is now installed in $(HOST_DIR), since
it is used to build third party Python modules.
* The BR2_PACKAGE_PYTHON_DEV option is removed since
BR2_HAVE_DEVFILES already does the necessary work.
* The "make -i install" workaround introduced by Maxime Ripard is no
longer needed. It was caused by the compilation of the tests that
required the unicodedata module (which wasn't built in the host
Python interpreter). Since we no longer compile the Python tests,
the problem doesn't exist anymore and we can avoid this "-i"
option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-12-26 10:28:49 +01:00
|
|
|
|
2017-03-08 00:00:26 +01:00
|
|
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
|
|
|
index b2a0490..974a052 100644
|
2014-02-13 21:48:53 +01:00
|
|
|
--- a/Makefile.pre.in
|
|
|
|
+++ b/Makefile.pre.in
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -1043,7 +1043,6 @@ LIBSUBDIRS= lib-tk site-packages \
|
2014-02-13 21:48:53 +01:00
|
|
|
email email/mime \
|
2014-12-28 21:54:54 +01:00
|
|
|
ensurepip ensurepip/_bundled \
|
2014-02-13 21:48:53 +01:00
|
|
|
json \
|
2014-12-28 21:54:54 +01:00
|
|
|
- sqlite3 \
|
2014-02-13 21:48:53 +01:00
|
|
|
logging bsddb csv importlib wsgiref \
|
2014-06-28 23:52:21 +02:00
|
|
|
ctypes ctypes/macholib \
|
|
|
|
idlelib idlelib/Icons \
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -1061,7 +1060,6 @@ TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
|
2014-02-13 21:48:53 +01:00
|
|
|
test/tracedmodules \
|
|
|
|
email/test email/test/data \
|
|
|
|
json/tests \
|
|
|
|
- sqlite3/test \
|
|
|
|
bsddb/test \
|
|
|
|
ctypes/test \
|
2014-06-28 23:52:21 +02:00
|
|
|
idlelib/idle_test \
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -1084,6 +1082,11 @@ TESTSUBDIRS += lib2to3/tests \
|
2014-02-13 21:48:53 +01:00
|
|
|
lib2to3/tests/data/fixers/myfixes
|
2012-11-30 12:46:27 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
+ifeq (@SQLITE3@,yes)
|
|
|
|
+LIBSUBDIRS += sqlite3
|
2014-02-13 21:48:53 +01:00
|
|
|
+TESTSUBDIRS += sqlite3/test
|
2012-11-30 12:46:27 +01:00
|
|
|
+endif
|
|
|
|
+
|
|
|
|
libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
|
|
|
@for i in $(SCRIPTDIR) $(LIBDEST); \
|
|
|
|
do \
|
2017-03-08 00:00:26 +01:00
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
|
|
index 270f337..e9e1897 100644
|
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
|
|
|
@@ -2805,6 +2805,15 @@ if test "$posix_threads" = "yes"; then
|
|
|
|
AC_CHECK_FUNCS(pthread_atfork)
|
|
|
|
fi
|
|
|
|
|
|
|
|
+AC_SUBST(SQLITE3)
|
|
|
|
+AC_ARG_ENABLE(sqlite3,
|
|
|
|
+ AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]),
|
|
|
|
+ [ SQLITE3="${enableval}" ], [ SQLITE3=yes ])
|
|
|
|
+
|
|
|
|
+if test "$SQLITE3" = "no" ; then
|
|
|
|
+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
AC_SUBST(PYDOC)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(pydoc,
|
|
|
|
--
|
|
|
|
2.7.4
|
|
|
|
|