summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-12 03:12:58 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-12 03:40:20 +0300
commit1606607bd42ce36f7d892c14b29046b7152d0fa6 (patch)
treed755b98dd712d4fb1ffa8d21aaf50334dcd010b4
parent457c0a606c5b319bc50902601c5bca0f53641911 (diff)
downloadmicropython-1606607bd42ce36f7d892c14b29046b7152d0fa6.tar.gz
micropython-1606607bd42ce36f7d892c14b29046b7152d0fa6.zip
modure: Make sure that re1.5 compiled in only of modure itself is enabled.
This is achieved by including re1.5 *.c files straight from modure.c .
-rw-r--r--extmod/modure.c8
-rw-r--r--py/py.mk7
2 files changed, 8 insertions, 7 deletions
diff --git a/extmod/modure.c b/extmod/modure.c
index b6560599ae..7acc045e70 100644
--- a/extmod/modure.c
+++ b/extmod/modure.c
@@ -238,4 +238,12 @@ const mp_obj_module_t mp_module_ure = {
.globals = (mp_obj_dict_t*)&mp_module_re_globals,
};
+// Source files #include'd here to make sure they're compiled in
+// only if module is enabled by config setting.
+
+#define re1_5_fatal(x) assert(!x)
+#include "re1.5/compilecode.c"
+#include "re1.5/dumpcode.c"
+#include "re1.5/recursiveloop.c"
+
#endif //MICROPY_PY_URE
diff --git a/py/py.mk b/py/py.mk
index bd5e69598c..e74d557e41 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -114,9 +114,6 @@ PY_O_BASENAME = \
../extmod/modzlibd.o \
../extmod/modujson.o \
../extmod/modure.o \
- ../extmod/re1.5/compilecode.o \
- ../extmod/re1.5/dumpcode.o \
- ../extmod/re1.5/recursiveloop.o \
# prepend the build destination prefix to the py object files
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
@@ -169,7 +166,3 @@ $(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT)
# optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster)
$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT)
-
-# Additional options for 3rd-party libs
-
-$(PY_BUILD)/../extmod/re1.5/recursiveloop.o: CFLAGS += "-Dre1_5_fatal(x)=assert(!x)"