Commit Graph

50 Commits

Author SHA1 Message Date
Paul Sokolovsky c39368427c unix: Rename module sources per latest naming conventions (mod*.c). 2014-04-04 20:34:10 +03:00
Paul Sokolovsky 793838a919 MICROPY_USE_READLINE: Selects link lib, so should be defined in mpconfigport.mk
This change allows to build unix version without libreadline installed.
2014-02-28 11:09:29 +02:00
Gordon McGregor 3890ec48e7 OS X compatible -map syntax for LDFLAGS 2014-02-14 16:38:05 -06:00
Paul Sokolovsky 5be1b2873b unix Makefile: Split off optimization options to COPT variable.
To allow easily try different optimization and configuration options
without patching any files.
2014-02-12 20:20:39 +02:00
Damien George 323f39a2b3 Merge pull request #278 from pfalcon/unix-gc
Enable GC for Unix port
2014-02-11 21:42:09 +00:00
Paul Sokolovsky e7db8171d8 unix: Implement garbage collection support. 2014-02-11 16:20:02 +02:00
Paul Sokolovsky 287d9620fc Enable link map file generation. 2014-02-11 14:42:20 +02:00
Paul Sokolovsky a9459bc723 unix: Add basic time module (with time() and clock() functions).
Both return int so far (single-precision float doesn't have enough
bits to represent int32 precisely).
2014-02-02 01:34:11 +02:00
Damien George a908202d60 unix: libffi include path now found using pkg-config.
Hopefully this works for other people as well :)
2014-02-01 18:48:19 +00:00
Paul Sokolovsky ed1239fce6 Add mpconfigport.mk file to configure which modules to include into build.
Proof of concept, controls "ffi" module as one which requires external
dependencies.
2014-02-01 20:09:45 +02:00
Damien George 8bf91f2a87 unix: Fix compile warnings for ffi module on 64-bit machine. 2014-01-28 23:08:11 +00:00
Paul Sokolovsky 60a9fac8d4 unix: Initial implementation of FFI module.
Foreign Function Interface module allows to load native dynamic libraries,
call functions and access variables in them. This makes possible to write
interface modules in pure Python.

This module provides thin wrapper around libffi. ctypes compatibility might
be possible to implement on top of this module (though ctypes allow to call
functions without prototypes, which is not supported by libffi (i.e.
implementation would be inefficient))).
2014-01-29 00:24:00 +02:00
Damien George 56bb636014 Change -Og to -O0 in unix-cpy/Makefile; cast to small int in socket.c. 2014-01-26 17:52:23 +00:00
Paul Sokolovsky e2febe90e3 unix Makefile: -Og doesn't work (at least) with gcc 4.6 below.
Also, don't try to force debug info format, use native.
2014-01-25 19:49:38 +02:00
Dave Hylands c89c681a9f Rework makefiles. Add proper dependency checking. 2014-01-24 08:46:48 -08:00
Damien George 55baff4c9b Revamp qstrs: they now include length and hash.
Can now have null bytes in strings.  Can define ROM qstrs per port using
qstrdefsport.h
2014-01-21 21:40:13 +00:00
Damien George 7d08935458 Rename unix binary to 'micropython'. 2014-01-20 00:02:39 +00:00
Paul Sokolovsky fc92608237 Add lean ("raw") socket module. 2014-01-19 00:16:39 +02:00
Damien George 5573f9f150 Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2int
Conflicts:
	py/objint.c
	unix-cpy/Makefile
	unix/Makefile
2014-01-15 22:58:39 +00:00
xyb c178ea471e Implemented int(str) in UNIX 2014-01-14 21:39:05 +08:00
John R. Lenton 9549919349 made DEBUG control CFLAGS in Makefiles oter than stm as well. 2014-01-13 13:25:10 +00:00
Dave Hylands 4646801181 Make build output quieter.
Use make V=1e make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.

This should fix issue #117
2014-01-08 10:30:06 -08:00
Paul Sokolovsky e0e79ae6d6 unix: Add basic implementation of io.FileIO object.
Note: only read/write/close methods are defined so far, and class
is not exposed (use open() factory function, as usual).
2014-01-08 17:39:06 +02:00
Damien George 136f67523b Factor and simplify Makefile's and mpconfig. 2014-01-07 14:54:15 +00:00
Damien George 71c5181a8d Convert Python types to proper Python type hierarchy.
Now much more inline with how CPython does types.
2014-01-04 20:21:15 +00:00
Paul Sokolovsky d674bd5989 Convert USE_READLINE config option to be consistent with others. 2014-01-04 19:38:19 +02:00
Damien George e67ed5d285 Improve configurability for native x64/thumb emitter.
With MICROPY_EMIT_X64 and MICROPY_EMIT_THUMB disabled, the respective
emitters and assemblers will not be included in the code.  This can
significantly reduce binary size for unix version.
2014-01-04 13:55:24 +00:00
Paul Sokolovsky 1c6de11f77 Add basic implementation of slice object.
So far, only start and stop integer indexes are supported. Step is
not supported, as well as objects of arbitrary types.
2014-01-04 02:35:48 +02:00
Paul Sokolovsky b372bfca21 Rename default config file to mpconfig.h, and port's to mpconfigport.h.
mpconfig.h will automatically pull mpconfigport.h.
2014-01-03 19:03:11 +02:00
Damien George 66028ab6dc Basic implementation of import.
import works for simple cases.  Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
2014-01-03 14:03:48 +00:00
Damien George 2870862601 Add module object, to be used eventually for import. 2014-01-02 21:30:26 +00:00
Damien George 210a02e105 unix: revert Makefile to not use -ltermcap.
termcap is not needed on Linux.  Need to work out how to automatically
configure the Makefile...
2014-01-02 15:50:33 +00:00
Edd Barrett 0d02eb178a Fix undefined termcap symbols on OpenBSD.
E.g.:
/usr/lib/libreadline.so.4.0: undefined reference to `tgetnum'
/usr/lib/libreadline.so.4.0: undefined reference to `tgoto'
/usr/lib/libreadline.so.4.0: undefined reference to `tgetflag'
/usr/lib/libreadline.so.4.0: undefined reference to `tputs'
/usr/lib/libreadline.so.4.0: undefined reference to `tgetent'
/usr/lib/libreadline.so.4.0: undefined reference to `tgetstr'

Tested on linux too, works.
2014-01-01 23:26:36 +00:00
Paul Sokolovsky fa027672da Make GNU Readline usage optional (USE_READLINE define). Still enabled.
Readline is GPL, so linking with it casts the binary GPL.
2014-01-01 18:28:01 +02:00
Paul Sokolovsky e1151e463d Use rm -rf to remove build dir, so it doesn't error out if dir doesn't exist. 2013-12-30 21:02:10 +02:00
Damien George 8cc96a35e5 Put unicode functions in unicode.c, and tidy their names. 2013-12-30 18:23:50 +00:00
Damien George 212c296c0b Make unix-cpy cross platform; remove dependency of asmx64 on mpconfig. 2013-12-30 12:52:32 +00:00
Paul Sokolovsky e85c38992d Make "unix" target be crossplatform and support x86, x64, ARM hosts. 2013-12-30 03:38:32 +02:00
Paul Sokolovsky 729fd12fbf Don't error out if build/ directory already exists. 2013-12-29 20:12:33 +02:00
Damien de690d128b Add unix-cpy, used to test Micro Python byte code against CPython. 2013-12-29 18:01:01 +00:00
Damien d99b05282d Change object representation from 1 big union to individual structs.
A big change.  Micro Python objects are allocated as individual structs
with the first element being a pointer to the type information (which
is itself an object).  This scheme follows CPython.  Much more flexible,
not necessarily slower, uses same heap memory, and can allocate objects
statically.

Also change name prefix, from py_ to mp_ (mp for Micro Python).
2013-12-21 18:17:45 +00:00
Damien e2880aa2fd Fix a few compiler warnings. 2013-12-20 14:22:59 +00:00
Damien 0f08267fa4 unix: include obj.h, and build additional py files. 2013-12-17 18:33:53 +00:00
Damien 1895cf91af Link showbc.o in unix version. 2013-11-17 13:20:13 +00:00
Damien 7410e440ab Add basic complex number support. 2013-11-02 19:47:57 +00:00
Damien 92c06561a3 Improve REPL compount statement detection. 2013-10-22 22:32:27 +01:00
Damien a5185f4bc8 Abstract out back-end stream functionality from lexer. 2013-10-20 14:41:27 +01:00
Damien 5ac1b2efbd Implement REPL. 2013-10-18 19:58:12 +01:00
Damien ce89a21ea4 Implement basic exception framework, and simple for loop. 2013-10-15 22:25:17 +01:00
Damien c025ebb2dc Separate out mpy core and unix version. 2013-10-12 14:30:21 +01:00