Rationale:
- There is no port under targets/ that would use it. All of them
turn it off when building.
- That's no surprise, as jerry-libc supports no barebone MCUs but
posix targets with syscalls only. Actually, that's Linux only,
because macOS builds have turned off the use of jerry-libc a
while ago.
- And there is no point in maintaining a highly restricted set of
libc functions: as soon as someone wants to use JerryScript in a
scenario that needs more functions than jerry-main, they have to
choose a different libc (most problably the compiler's default
one).
I think that we should not keep supporting an otherwise unused
library for the purposes of jerry-main on arm/x86/x64-linux only.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Container-based VMs promise significantly faster boot times.
More or less related changes:
- Added a JOBNAME to all jobs.
- Added `install-noapt` target to several Makefile.travis files to
avoid `sudo apt-get install ...` steps. Those installations are
now handled by the apt addon of Travis. The `install` targets are
kept anyway to keep the makefiles self-contained.
- Removed a legacy workaround from the Coverity Scan job as it
isn't necessary anymore to fiddle with the cerificates of
scan.coverity.com.
- Fixed the Mbed and the Zephyr jobs.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This patch uses the onboard RTC for generating random seed. It also improves the print handler to support float values.
The rom segment is slightly increased to fit to the latest master.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
The 'external' toolchain file does nothing but transitively sets
some cmake system variables from values received on the command
line, and forcibly sets the C compiler. However, the same cmake
system variables can be directly set via the command line, together
with the C compiler, and specifying a toolchain is not a must.
Thus, this patch drops the superfluous 'external' toolchain file
and updates cmake-based targets to invoke cmake in a simpler form.
Related changes in this commit:
- While updating the cmake invocations, all the command line
arguments have been reviewed and simplified (removed those, which
did not change the defaults).
- Removed unnecessary forced C compiler settings from some
toolchain files (and/or changed them to setting the "compiler
works" flag to true, thus keeping cmake's compiler identification
logic but disabling some of its overzealous compiler sanity
checks).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Hitherto, code under the `targets` directory was not tested and so
its maintenance was sometimes speculative. This commit adds build
testing for several targets to prevent them from bit rotting.
Targets covered by this commit are: ESP8266, Mbed, Mbed OS 5,
NuttX, RIOT, Tizen RT, and Zephyr.
Some issues were revealed and fixed:
- ESP8266: added missing include for `uint32_t` typedef.
- Tizen RT: replaced missing `str_to_uint` with `strtol`.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This patch updates ESP8266 build system and code base as well.
- Removed unnecessary files.
- Decreased code size.
- Refactored jerry_{port, extapi, run}.c to make it more easy to handle.
- Readme.md is updated as well which contains detailed step by step description about how to set up environment and use JerryScript.
Finally, it solves the related issue #1375.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Moved all public API headers under the `jerry-core/include`
directory. This makes installing all the public headers easier.
Also, should we have new public headers in the future, their
installation will be automatic, there will be no need to update the
build files. Moreover, this aligns better with the structure of
other libraries in the project (in those cases, public headers
always reside in `<library>/include`).
Moved all public API implementations under the `jerry-core/api`
directory. This cleans up the root directory of `jerry-core`,
moving all implementation code under "modules", i.e.,
subdirectories. This also makes the future splitting of the big and
monolithic `jerry.c` along features easier, if needed. (Debugger
and snapshot-related functions are already in separate sources.)
Notes:
* `jerryscript.h` is split up to separate header files along
feature boundaries. These new headers are included by
`jerryscript.h`, so this is not a breaking change but header
modularization only.
* `jerry-snapshot.h` is still under `jerry-core/api`, keeping it as
a non-public header.
* This commit also adapts all targets to the include path change.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The built-in `print` is removed from jerry-core, but an external
`print` implementation is added to jerry-main. From now on, all
embedders of the engine have to implement their own `print` if they
need such a functionality.
For printing results in REPL mode of jerry-main, the external
`print` handler is called directly instead of looking up the `print`
function registered into the global object. (The two are the same,
but the indirection is not needed anymore.)
Because jerry-core does not contain `print` anymore,
`jerry_port_console` is removed from the port API. The default port
is updated, i.e., the implementation of `jerry_port_console` is
removed. Additionally, all references to `jerry_port_console` in
jerry-main are replaced by `printf`.
Speculatively, `jerry_port_console` is also removed from all
non-default targets. Most targets implemented it for the sake of the
engine only; in those targets the removal was trivial. Where the
function was called from the embedder application as well, the
calls were replaced with equivalents (e.g., `printf`, `printk`).
NOTE 1: This is a breaking change!
NOTE 2: This patch still leaves several targets without a JS `print`
implementation.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
All public headers should follow the pattern `jerryscript[-*].h`.
The `jerry-api.h` to `jerryscript.h` renaming has already happened
a while ago, now it's time for the port API header to follow.
This patch
* renames the public header file,
* updates all includes to use the new file name (in `jerry-main`,
in all the targets, and in the docs), and
* keeps `jerry-port.h` as a deprecated forwarding header to leave
some time for external users to follow up with this change.
As a related change, the header of the default port implementation
is also changed to `jerryscript-port-default.h`.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Add a notification for JerryScript API users that the jerry-api.h
will be removed in the future and should use the jerryscript.h
header instead.
Also update the examples in the docs and the targets where
the jerry-api.h is used.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Extern keywords on function declarations/definitions provide no additional value since function declarations/definitions default to external linkage in C99, e.g. removing them won't change the semantics of the program.
The extern keywords were essentially a legacy from the early days of the project. This commit cleans this up across the whole codebase in one go to minimize history disruption.
The bulk of the changes in this commit were produced by a custom clang-tidy checker.
Note that variables declarations carrying the extern keyword are untouched by this commit since there the presence of the keyword actually has an impact on the semantics of the program.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.
Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):
"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)
This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.
Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
* Rename 'jerry_targetjs.h' to 'jerry-targetjs.h',
because we use dashes in filen ames instead of underscores.
* Made destination and js souce directory configurable.
* Updated esp8266 target to the recent changes.
* Updated mbed and mbedos5 target to the recent changes.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Related issue: #964
Implemented the IO API of Jerry ports. Removed log file from API level.
The port implementation should define the destination of log messages.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Recent changes eliminate the need for `jerry_port_putchar`. As port
API discussions don't make it likely that it will ever be needed
again, this patch removes its declaration from jerry-port.h and its
implementations from the port(s).
The related code in jerry-libc is not needed either: whatever `putc`
(and `puts`) can do, `printf` can do as well.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Apps that use jerry should not (must not!) include and rely on its
internal headers. Typical issue is the use of "jrt/jrt.h". Fixing
`main-{unix,mcu}.c`, and speculatively the apps under the `targets`
directory as well.
(Note: a fix can be either including "jerry-port.h" and using
functions declared there, e.g., `jerry_port_errormsg`, or simply
using standard libc function like `printf`. Both approaches occur
in this patch.)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
* Rename modified fdlibm to jerry-libm
* Move third-party/fdlibm to jerry-libm
* Rename original fdlibm.h to jerry-libm-internal.h
* And remove it from the public headers.
* Rename jerry-libm's public header to math.h
* This also makes jerry-core sources include `<math.h>`. Therefore,
should anyone want to use a different libm implementation with
jerry, it becomes possible. (The same way as we provide a minimal
libc with standard headers, but should it be insufficient or
conflicting for someone, it can be replaced.)
* Drop `s_` prefix from jerry-libm sources
* The original fdlibm implementation had various prefixes (e.g., `k_`
for sources of kernel routines, and `w_` for wrapper routines), but
after the specialization of fdlibm to jerry, only `s_` remained.
Since it does not encode anything anymore, it can be dropped.
* Stylistic edits to jerry-libm's CMakeLists
* Align project name with other CMakeLists in the code base
* Move Jerry-LibM under Apache License
* Using the same approach as was used by linux-wireless when ath5k
driver license needed clarification. Solution was proposed by SFLC.
External mail for future reference: http://lwn.net/Articles/247806/
* Tests & checks
* Remove FD from the name of libm unit test-related files
* Make vera++ and cppcheck check jerry-libm
* Targets
* Speculative update of targets to use jerry-libm
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu