Commit ee3fd46f authored by Damien George's avatar Damien George
Browse files

Rename configuration variables controling Python features.

Now of the form MICROPY_PY_*.  See issue #35.
parent d0ceb04b
......@@ -125,7 +125,7 @@ Q(bool)
Q(bytearray)
Q(bytes)
Q(callable)
#if MICROPY_ENABLE_MOD_STRUCT
#if MICROPY_PY_STRUCT
Q(calcsize)
#endif
Q(chr)
......@@ -257,11 +257,11 @@ Q(iterator)
Q(module)
Q(slice)
#if MICROPY_ENABLE_FROZENSET
#if MICROPY_PY_FROZENSET
Q(frozenset)
#endif
#if MICROPY_ENABLE_MOD_MATH || MICROPY_ENABLE_MOD_CMATH
#if MICROPY_PY_MATH || MICROPY_PY_CMATH
Q(math)
Q(e)
Q(pi)
......@@ -305,7 +305,7 @@ Q(gamma)
Q(lgamma)
#endif
#if MICROPY_ENABLE_MOD_CMATH
#if MICROPY_PY_CMATH
Q(cmath)
Q(phase)
Q(polar)
......@@ -331,7 +331,7 @@ Q(decode)
Q(utf-8)
#endif
#if MICROPY_ENABLE_MOD_SYS
#if MICROPY_PY_SYS
Q(argv)
Q(byteorder)
Q(big)
......@@ -344,13 +344,13 @@ Q(version)
Q(version_info)
#endif
#if MICROPY_ENABLE_MOD_STRUCT
#if MICROPY_PY_STRUCT
Q(struct)
Q(pack)
Q(unpack)
#endif
#if MICROPY_ENABLE_MOD_IO
#if MICROPY_PY_IO
Q(io)
Q(readall)
Q(readline)
......@@ -362,14 +362,14 @@ Q(BytesIO)
Q(getvalue)
#endif
#if MICROPY_ENABLE_MOD_GC
#if MICROPY_PY_GC
Q(gc)
Q(collect)
Q(disable)
Q(enable)
#endif
#if MICROPY_ENABLE_PROPERTY
#if MICROPY_PY_PROPERTY
Q(property)
Q(getter)
Q(setter)
......
......@@ -419,7 +419,7 @@ void mp_bytecode_print2(const byte *ip, int len) {
printf("SET_ADD " UINT_FMT, unum);
break;
#if MICROPY_ENABLE_SLICE
#if MICROPY_PY_SLICE
case MP_BC_BUILD_SLICE:
DECODE_UINT;
printf("BUILD_SLICE " UINT_FMT, unum);
......
......@@ -762,7 +762,7 @@ unwind_jump:
sp--;
DISPATCH();
#if MICROPY_ENABLE_SLICE
#if MICROPY_PY_SLICE
ENTRY(MP_BC_BUILD_SLICE):
DECODE_UINT;
if (unum == 2) {
......
......@@ -14,7 +14,7 @@
#define MICROPY_ENABLE_SOURCE_LINE (0)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
#define MICROPY_ENABLE_MOD_IO (0)
#define MICROPY_PY_IO (0)
// type definitions for the specific machine
......
......@@ -33,7 +33,6 @@
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_ENABLE_SOURCE_LINE (1)
#define MICROPY_ENABLE_FROZENSET (1)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_OPT_COMPUTED_GOTO (1)
......@@ -45,9 +44,10 @@
*/
#define MICROPY_ENABLE_LFN (1)
#define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_PY_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_CMATH (1)
// extra built in names to add to the global namespace
extern const struct _mp_obj_fun_native_t mp_builtin_help_obj;
......
......@@ -29,7 +29,7 @@
#define MICROPY_EMIT_CPYTHON (1)
#define MICROPY_HELPER_LEXER_UNIX (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_ENABLE_MOD_IO (0)
#define MICROPY_PY_IO (0)
// type definitions for the specific machine
......
......@@ -27,7 +27,7 @@ UNAME_S := $(shell uname -s)
ifeq ($(MICROPY_FORCE_32BIT),1)
CFLAGS += -m32
LDFLAGS += -m32
ifeq ($(MICROPY_MOD_FFI),1)
ifeq ($(MICROPY_PY_FFI),1)
ifeq ($(UNAME_S),Linux)
CFLAGS_MOD += -I/usr/include/i686-linux-gnu
endif
......@@ -40,14 +40,14 @@ LDFLAGS_MOD += -lreadline
# the following is needed for BSD
#LDFLAGS_MOD += -ltermcap
endif
ifeq ($(MICROPY_MOD_TIME),1)
CFLAGS_MOD += -DMICROPY_MOD_TIME=1
ifeq ($(MICROPY_PY_TIME),1)
CFLAGS_MOD += -DMICROPY_PY_TIME=1
SRC_MOD += modtime.c
endif
ifeq ($(MICROPY_MOD_FFI),1)
ifeq ($(MICROPY_PY_FFI),1)
LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi)
LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi)
CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_MOD_FFI=1
CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_PY_FFI=1
LDFLAGS_MOD += -ldl $(LIBFFI_LDFLAGS_MOD)
SRC_MOD += modffi.c
endif
......
......@@ -131,7 +131,7 @@ STATIC mp_obj_t fdfile_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const
case '+':
mode |= O_RDWR;
break;
#if MICROPY_MOD_IO_FILEIO
#if MICROPY_PY_IO_FILEIO
// If we don't have io.FileIO, then files are in text mode implicitly
case 'b':
type = &mp_type_fileio;
......@@ -173,7 +173,7 @@ STATIC const mp_map_elem_t rawfile_locals_dict_table[] = {
STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table);
#if MICROPY_MOD_IO_FILEIO
#if MICROPY_PY_IO_FILEIO
STATIC const mp_stream_p_t fileio_stream_p = {
.read = fdfile_read,
.write = fdfile_write,
......
......@@ -32,7 +32,6 @@
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_ENABLE_FROZENSET (1)
#define MICROPY_MEM_STATS (1)
#define MICROPY_DEBUG_PRINTERS (1)
#define MICROPY_HELPER_REPL (1)
......@@ -42,10 +41,11 @@
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_OPT_COMPUTED_GOTO (1)
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_MOD_IO_FILEIO (1)
#define MICROPY_PY_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO_FILEIO (1)
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
// names in exception messages (may require more RAM).
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
......@@ -55,20 +55,20 @@ 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 },
#if MICROPY_PY_FFI
#define MICROPY_PY_FFI_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_ffi), (mp_obj_t)&mp_module_ffi },
#else
#define MICROPY_MOD_FFI_DEF
#define MICROPY_PY_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 },
#if MICROPY_PY_TIME
#define MICROPY_PY_TIME_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_time },
#else
#define MICROPY_MOD_TIME_DEF
#define MICROPY_PY_TIME_DEF
#endif
#define MICROPY_PORT_BUILTIN_MODULES \
MICROPY_MOD_FFI_DEF \
MICROPY_MOD_TIME_DEF \
MICROPY_PY_FFI_DEF \
MICROPY_PY_TIME_DEF \
{ MP_OBJ_NEW_QSTR(MP_QSTR_microsocket), (mp_obj_t)&mp_module_socket }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR__os), (mp_obj_t)&mp_module_os }, \
......
......@@ -7,7 +7,7 @@ MICROPY_FORCE_32BIT = 0
MICROPY_USE_READLINE = 1
# Subset of CPython time module
MICROPY_MOD_TIME = 1
MICROPY_PY_TIME = 1
# ffi module requires libffi (libffi-dev Debian package)
MICROPY_MOD_FFI = 1
MICROPY_PY_FFI = 1
......@@ -39,10 +39,10 @@
#define MICROPY_DEBUG_PRINTERS (1)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_HELPER_LEXER_UNIX (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_MOD_SYS_EXIT (1)
#define MICROPY_ENABLE_FROZENSET (1)
#define MICROPY_PY_FROZENSET (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_PORT_INIT_FUNC init()
......
......@@ -7,7 +7,7 @@ MICROPY_FORCE_32BIT = 0
MICROPY_USE_READLINE = 0
# Subset of CPython time module
MICROPY_MOD_TIME = 1
MICROPY_PY_TIME = 1
# ffi module requires libffi (libffi-dev Debian package)
MICROPY_MOD_FFI = 0
MICROPY_PY_FFI = 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment