summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2014-05-12 21:46:29 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-13 00:03:24 +0300
commitf42dbb98d10104df4d0db65c89e1788035ca6788 (patch)
tree6ece1fb9b4b24155603b6f027ea2398df22303ad
parentdf94b717b42bea39c1794a38bc10254e4f924e22 (diff)
downloadmicropython-f42dbb98d10104df4d0db65c89e1788035ca6788.tar.gz
micropython-f42dbb98d10104df4d0db65c89e1788035ca6788.zip
unix: Fix linker errors when time/ffi modules are disabled
When disabling these via mpconfigport.mk or on the commandline, the correspoding build options are not set and the sources are not built so the modules should not be added to the MICROPY_EXTRA_BUILTIN_MODULES list since they are undefined.
-rw-r--r--unix/mpconfigport.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index 4f347f4e02..a0a627d57e 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -52,9 +52,21 @@
extern const struct _mp_obj_module_t mp_module_time;
extern const struct _mp_obj_module_t mp_module_socket;
extern const struct _mp_obj_module_t mp_module_ffi;
+
+#if MICROPY_MOD_FFI
+#define MICROPY_MOD_FFI_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_ffi), (mp_obj_t)&mp_module_ffi },
+#else
+#define MICROPY_MOD_FFI_DEF
+#endif
+#if MICROPY_MOD_TIME
+#define MICROPY_MOD_TIME_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_time },
+#else
+#define MICROPY_MOD_TIME_DEF
+#endif
+
#define MICROPY_EXTRA_BUILTIN_MODULES \
- { MP_OBJ_NEW_QSTR(MP_QSTR_ffi), (mp_obj_t)&mp_module_ffi }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_time }, \
+ MICROPY_MOD_FFI_DEF \
+ MICROPY_MOD_TIME_DEF \
{ MP_OBJ_NEW_QSTR(MP_QSTR_microsocket), (mp_obj_t)&mp_module_socket }, \
// type definitions for the specific machine