Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
ee3fd46f
Commit
ee3fd46f
authored
May 24, 2014
by
Damien George
Browse files
Rename configuration variables controling Python features.
Now of the form MICROPY_PY_*. See issue #35.
parent
d0ceb04b
Changes
32
Hide whitespace changes
Inline
Side-by-side
py/qstrdefs.h
View file @
ee3fd46f
...
@@ -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
)
...
...
py/showbc.c
View file @
ee3fd46f
...
@@ -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
);
...
...
py/vm.c
View file @
ee3fd46f
...
@@ -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
)
{
...
...
qemu-arm/mpconfigport.h
View file @
ee3fd46f
...
@@ -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
...
...
stmhal/mpconfigport.h
View file @
ee3fd46f
...
@@ -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
;
...
...
unix-cpy/mpconfigport.h
View file @
ee3fd46f
...
@@ -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
...
...
unix/Makefile
View file @
ee3fd46f
...
@@ -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
...
...
unix/file.c
View file @
ee3fd46f
...
@@ -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
,
...
...
unix/mpconfigport.h
View file @
ee3fd46f
...
@@ -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 }, \
...
...
unix/mpconfigport.mk
View file @
ee3fd46f
...
@@ -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
windows/mpconfigport.h
View file @
ee3fd46f
...
@@ -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()
...
...
windows/mpconfigport.mk
View file @
ee3fd46f
...
@@ -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
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment