4b54e24cd5211b8a28515633a4836d2a0ff141b9
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python / 110-optional-db.patch
1 Add an option to disable bsddb
2
3 bsddb has an external dependency on Berkeley DB. Since we want to be
4 able to build Python without it, this patch adds an option to disable
5 the build/installation of this Python module.
6
7 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
9
10 ---
11  Makefile.pre.in |   10 ++++++++--
12  configure.in    |   22 ++++++++++++++++++++++
13  2 files changed, 30 insertions(+), 2 deletions(-)
14
15 Index: b/Makefile.pre.in
16 ===================================================================
17 --- a/Makefile.pre.in
18 +++ b/Makefile.pre.in
19 @@ -965,7 +965,7 @@
20                 email email/mime \
21                 ensurepip ensurepip/_bundled \
22                 json \
23 -               logging bsddb csv importlib wsgiref \
24 +               logging csv importlib wsgiref \
25                 ctypes ctypes/macholib \
26                 idlelib idlelib/Icons \
27                 distutils distutils/command \
28 @@ -981,7 +981,6 @@
29         test/tracedmodules \
30         email/test email/test/data \
31         json/tests \
32 -       bsddb/test \
33         ctypes/test \
34         idlelib/idle_test \
35         distutils/tests \
36 @@ -1022,6 +1021,11 @@
37  LIBSUBDIRS += $(XMLLIBSUBDIRS)
38  endif
39  
40 +ifeq (@BSDDB@,yes)
41 +LIBSUBDIRS += bsddb
42 +TESTSUBDIRS += bsddb/test
43 +endif
44 +
45  libinstall:    build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
46         @for i in $(SCRIPTDIR) $(LIBDEST); \
47         do \
48 Index: b/configure.ac
49 ===================================================================
50 --- a/configure.ac
51 +++ b/configure.ac
52 @@ -2656,6 +2656,28 @@
53              DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis"
54           fi])
55  
56 +AC_ARG_ENABLE(dbm,
57 +       AS_HELP_STRING([--disable-dbm], [disable DBM]),
58 +       [ if test "$enableval" = "no"; then
59 +            DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} dbm"
60 +         fi])
61 +
62 +AC_ARG_ENABLE(gdbm,
63 +       AS_HELP_STRING([--disable-gdbm], [disable GDBM]),
64 +       [ if test "$enableval" = "no"; then
65 +            DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} gdbm"
66 +         fi])
67 +
68 +AC_SUBST(BSDDB)
69 +AC_ARG_ENABLE(bsddb,
70 +       AS_HELP_STRING([--disable-bsddb], [disable BerkeyleyDB]),
71 +       [ if test "$enableval" = "no"; then
72 +            BSDDB=no
73 +            DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _bsddb"
74 +         else
75 +            BSDDB=yes
76 +         fi], [ BSDDB=yes ])
77 +
78  AC_ARG_ENABLE(unicodedata,
79         AS_HELP_STRING([--disable-unicodedata], [disable unicodedata]),
80         [ if test "$enableval" = "no"; then