Skip to content

Commit 4384236

Browse files
committed
Enabled sockets. removed unused configurations.
1 parent ee49aa3 commit 4384236

File tree

11 files changed

+68
-535
lines changed

11 files changed

+68
-535
lines changed

frosted/Makefile

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ifdef DEBUG
3030
CFLAGS += -g
3131
COPT = -O0
3232
else
33-
COPT = -Os -fdata-sections -ffunction-sections -D__frosted__ #-DNDEBUG
33+
COPT = -Os -fdata-sections -ffunction-sections -D__frosted__ -DNDEBUG
3434
# _FORTIFY_SOURCE is a feature in gcc/glibc which is intended to provide extra
3535
# security for detecting buffer overflows. Some distros (Ubuntu at the very least)
3636
# have it enabled by default.
@@ -227,50 +227,6 @@ install: micropython
227227
uninstall:
228228
-rm $(BINDIR)/$(TARGET)
229229

230-
# build synthetically fast interpreter for benchmarking
231-
fast:
232-
$(MAKE) COPT="-O2 -DNDEBUG -fno-crossjumping" CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_fast.h>"' BUILD=build-fast PROG=micropython_fast
233-
234-
# build a minimal interpreter
235-
minimal:
236-
$(MAKE) COPT="-Os -DNDEBUG" CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_minimal.h>"' \
237-
BUILD=build-minimal PROG=micropython_minimal FROZEN_DIR= \
238-
MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_SOCKET=0 MICROPY_PY_THREAD=0 \
239-
MICROPY_PY_TERMIOS=0 MICROPY_PY_USSL=0 \
240-
MICROPY_USE_READLINE=0 MICROPY_FATFS=0
241-
242-
# build interpreter with nan-boxing as object model
243-
nanbox:
244-
$(MAKE) \
245-
CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_nanbox.h>"' \
246-
BUILD=build-nanbox \
247-
PROG=micropython_nanbox \
248-
MICROPY_FORCE_32BIT=1 \
249-
MICROPY_PY_USSL=0
250-
251-
freedos:
252-
$(MAKE) \
253-
CC=i586-pc-msdosdjgpp-gcc \
254-
STRIP=i586-pc-msdosdjgpp-strip \
255-
SIZE=i586-pc-msdosdjgpp-size \
256-
CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_freedos.h>" -DMICROPY_NLR_SETJMP -Dtgamma=gamma -DMICROPY_EMIT_X86=0 -DMICROPY_NO_ALLOCA=1 -DMICROPY_PY_USELECT=0' \
257-
BUILD=build-freedos \
258-
PROG=micropython_freedos \
259-
MICROPY_PY_SOCKET=0 \
260-
MICROPY_PY_FFI=0 \
261-
MICROPY_PY_JNI=0
262-
263-
# build an interpreter for coverage testing and do the testing
264-
coverage:
265-
$(MAKE) COPT="-O0" CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_coverage.h>" -fprofile-arcs -ftest-coverage -Wdouble-promotion -Wformat -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -Wshadow -Wsign-compare -Wuninitialized -Wunused-parameter -DMICROPY_UNIX_COVERAGE' LDFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' BUILD=build-coverage PROG=micropython_coverage
266-
267-
coverage_test: coverage
268-
$(eval DIRNAME=$(notdir $(CURDIR)))
269-
cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests
270-
cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --emit native
271-
gcov -o build-coverage/py ../py/*.c
272-
gcov -o build-coverage/extmod ../extmod/*.c
273-
274230
# Value of configure's --host= option (required for cross-compilation).
275231
# Deduce it from CROSS_COMPILE by default, but can be overriden.
276232
ifneq ($(CROSS_COMPILE),)

frosted/coverage.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include "py/repl.h"
77
#include "py/mpz.h"
88

9-
#if defined(MICROPY_UNIX_COVERAGE)
10-
119
// str/bytes objects without a valid hash
1210
STATIC const mp_obj_str_t str_no_hash_obj = {{&mp_type_str}, 0, 10, (const byte*)"0123456789"};
1311
STATIC const mp_obj_str_t bytes_no_hash_obj = {{&mp_type_bytes}, 0, 10, (const byte*)"0123456789"};
@@ -120,4 +118,3 @@ STATIC mp_obj_t extra_coverage(void) {
120118
}
121119
MP_DEFINE_CONST_FUN_OBJ_0(extra_coverage_obj, extra_coverage);
122120

123-
#endif

frosted/file.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@
4040

4141
#if MICROPY_PY_IO
4242

43+
#ifdef _WIN32
44+
#define fsync _commit
45+
#endif
46+
4347
#ifdef __frosted__
4448
#define fsync(x) (0)
4549
#endif
4650

51+
4752
#ifdef MICROPY_CPYTHON_COMPAT
4853
STATIC void check_fd_is_open(const mp_obj_fdfile_t *o) {
4954
if (o->fd < 0) {
@@ -218,7 +223,6 @@ STATIC mp_obj_t fdfile_make_new(const mp_obj_type_t *type, size_t n_args, size_t
218223
STATIC const mp_rom_map_elem_t rawfile_locals_dict_table[] = {
219224
{ MP_ROM_QSTR(MP_QSTR_fileno), MP_ROM_PTR(&fdfile_fileno_obj) },
220225
{ MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) },
221-
{ MP_ROM_QSTR(MP_QSTR_readall), MP_ROM_PTR(&mp_stream_readall_obj) },
222226
{ MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
223227
{ MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) },
224228
{ MP_ROM_QSTR(MP_QSTR_readlines), MP_ROM_PTR(&mp_stream_unbuffered_readlines_obj) },

frosted/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ MP_NOINLINE int main_(int argc, char **argv) {
421421
#ifdef MICROPY_PY_SYS_PATH_DEFAULT
422422
path = MICROPY_PY_SYS_PATH_DEFAULT;
423423
#else
424-
path = "~/.micropython/lib:/usr/lib/micropython";
424+
path = "/bin";
425425
#endif
426426
}
427427
mp_uint_t path_num = 1; // [0] is for current dir (or base dir of the script)

frosted/modsocket.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ STATIC const mp_rom_map_elem_t usocket_locals_dict_table[] = {
349349
{ MP_ROM_QSTR(MP_QSTR_fileno), MP_ROM_PTR(&socket_fileno_obj) },
350350
{ MP_ROM_QSTR(MP_QSTR_makefile), MP_ROM_PTR(&socket_makefile_obj) },
351351
{ MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) },
352-
{ MP_ROM_QSTR(MP_QSTR_readall), MP_ROM_PTR(&mp_stream_readall_obj) },
353352
{ MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
354353
{ MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) },
355354
{ MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },

0 commit comments

Comments
 (0)