summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-06-15 00:52:45 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-06-15 00:52:45 +0300
commit337111ba9e393bad84d0f1bc45a291f462784d6e (patch)
treea9e3b97bc09892c1c1fb005f704c9500a30e29f6 /py
parent06b783cf58222ae616694b2c0b5de565de44349a (diff)
downloadmicropython-337111ba9e393bad84d0f1bc45a291f462784d6e.tar.gz
micropython-337111ba9e393bad84d0f1bc45a291f462784d6e.zip
py: Support to build berkeley db 1.85 and "btree" module.
Diffstat (limited to 'py')
-rw-r--r--py/builtin.h1
-rw-r--r--py/objmodule.c3
-rw-r--r--py/py.mk25
3 files changed, 29 insertions, 0 deletions
diff --git a/py/builtin.h b/py/builtin.h
index 5d79d2835e..349f49682e 100644
--- a/py/builtin.h
+++ b/py/builtin.h
@@ -113,6 +113,7 @@ extern const mp_obj_module_t mp_module_lwip;
extern const mp_obj_module_t mp_module_websocket;
extern const mp_obj_module_t mp_module_webrepl;
extern const mp_obj_module_t mp_module_framebuf;
+extern const mp_obj_module_t mp_module_btree;
// extmod functions
MP_DECLARE_CONST_FUN_OBJ(pyb_mount_obj);
diff --git a/py/objmodule.c b/py/objmodule.c
index c7cb644488..6d4b47958c 100644
--- a/py/objmodule.c
+++ b/py/objmodule.c
@@ -205,6 +205,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
#if MICROPY_PY_FRAMEBUF
{ MP_ROM_QSTR(MP_QSTR_framebuf), MP_ROM_PTR(&mp_module_framebuf) },
#endif
+#if MICROPY_PY_BTREE
+ { MP_ROM_QSTR(MP_QSTR_btree), MP_ROM_PTR(&mp_module_btree) },
+#endif
// extra builtin modules as defined by a port
MICROPY_PORT_BUILTIN_MODULES
diff --git a/py/py.mk b/py/py.mk
index 0b2b2246ec..79b876b994 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -16,6 +16,7 @@ endif
# some code is performance bottleneck and compiled with other optimization options
CSUPEROPT = -O3
+INC += -I../lib
INC += -I../lib/netutils
ifeq ($(MICROPY_PY_USSL),1)
@@ -63,6 +64,30 @@ SRC_MOD += $(LWIP_DIR)/netif/slipif.c
endif
endif
+ifeq ($(MICROPY_PY_BTREE),1)
+BTREE_DIR = lib/berkeley-db-1.xx
+CFLAGS_MOD += -D__DBINTERFACE_PRIVATE=1
+INC += -I../$(BTREE_DIR)/PORT/include
+SRC_MOD += extmod/modbtree.c
+SRC_MOD += $(addprefix $(BTREE_DIR)/,\
+btree/bt_close.c \
+btree/bt_conv.c \
+btree/bt_debug.c \
+btree/bt_delete.c \
+btree/bt_get.c \
+btree/bt_open.c \
+btree/bt_overflow.c \
+btree/bt_page.c \
+btree/bt_put.c \
+btree/bt_search.c \
+btree/bt_seq.c \
+btree/bt_split.c \
+btree/bt_utils.c \
+mpool/mpool.c \
+ )
+CFLAGS_MOD += -DMICROPY_PY_BTREE=1
+endif
+
# py object files
PY_O_BASENAME = \
mpstate.o \