py: Allow +, in, and compare ops between bytes and bytearray/array.

Eg b"123" + bytearray(2) now works.  This patch actually decreases code
size while adding functionality: 32-bit unix down by 128 bytes, stmhal
down by 84 bytes.
py: Allow bytes object as argument to some str methods.

This turns failing assertions to type exceptions for things like
b"123".find(...).  We still don't support operations like this on bytes
objects (unlike CPython), but at least it no longer crashes.
py: Fix some macros defines; cleanup some includes.
unix: Allow -X heapsize number take 'w' specifier for word size adjustment.

The specifier should go after the number, before size suffix like 'k' or 'm'.
E.g.: "-X heapsize=100wk" will use 100K heap on 32-bit system and 200K - on
64-bit.
py: Deactivate more code without MICROPY_PY_SYS

When compiler optimization has been turned on, gcc knows that this code
block is not going to be executed. But with -O0 it complains about
path_items being used uninitialized.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
bare-arm: Add dummy __assert_func and __fatal_error

Required to build bare-arm with debugging.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
stmhal: Declare variables extern in include files

Else we end up with several instances of the variable.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
py: Add order-only dependency for py-version.h

Else the directory might not exist.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
py: Remove obsolute function declaration.
py: Use shorter, static error msgs when ERROR_REPORTING_TERSE enabled.

Going from MICROPY_ERROR_REPORTING_NORMAL to
MICROPY_ERROR_REPORTING_TERSE now saves 2020 bytes ROM for ARM Thumb2,
and 2200 bytes ROM for 32-bit x86.

This is about a 2.5% code size reduction for bare-arm.
py: Fix order-only dependencies in mkrules.mk and py.mk.

Currently compilation sporadically fails, because the automatic
dependency gets created *during* the compilation of objects.

OBJ is a auperset of PY_O and the dependencies apply to all objects.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Disable stack check
py: Make import recognize and load native modules (.pyd or .so files)

Simply check if a .pyd or .so file exists on the Python search path
(if a .py file if not found) and call a function to get a module from it.
Implement this LoadDynLib function for msvc.
msvc: Build seperate micropython dll and executable

- export some core functions using exports.def, export constants/data using the
typical dllexport (exporting data using .def file yields multiple copies of data).
- rename micropython project to micropythoncore and have it produce a dll + import lib
- add new micropython exe project (which just calls the exported main from the dll)
- add run.h/run.c which allow for easy embedding
- add property sheet for external modules