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