diff options
author | Damien George <damien.p.george@gmail.com> | 2017-07-24 15:50:47 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-07-24 15:50:47 +1000 |
commit | 1ed3356540f55c9ed4167c87166f6d18b2868f9c (patch) | |
tree | 5c1cc7252836db21208a51450b5a3bbbcb60ad02 | |
parent | 513dfcf4fe3277fa1cb1e383db0b60e4a3fc843b (diff) | |
download | micropython-1ed3356540f55c9ed4167c87166f6d18b2868f9c.tar.gz micropython-1ed3356540f55c9ed4167c87166f6d18b2868f9c.zip |
py/py.mk: Make berkeley-db C-defs apply only to relevant source files.
Otherwise they can interfere (eg redefinition of "abort") with other source
files in a given uPy port.
-rw-r--r-- | py/py.mk | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -74,7 +74,7 @@ endif ifeq ($(MICROPY_PY_BTREE),1) BTREE_DIR = lib/berkeley-db-1.xx -CFLAGS_MOD += -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=<py/obj.h>" +BTREE_DEFS = -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=<py/obj.h>" INC += -I../$(BTREE_DIR)/PORT/include SRC_MOD += extmod/modbtree.c SRC_MOD += $(addprefix $(BTREE_DIR)/,\ @@ -95,7 +95,9 @@ mpool/mpool.c \ ) CFLAGS_MOD += -DMICROPY_PY_BTREE=1 # we need to suppress certain warnings to get berkeley-db to compile cleanly -$(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter +# and we have separate BTREE_DEFS so the definitions don't interfere with other source code +$(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter $(BTREE_DEFS) +$(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif # py object files |