diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e66abd2a..94c83a29d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ set(JERRY_CMDLINE_SNAPSHOT OFF CACHE BOOL "Build jerry snapshot command line to set(JERRY_LIBFUZZER OFF CACHE BOOL "Build jerry with libfuzzer support?") set(JERRY_PORT_DEFAULT ON CACHE BOOL "Build default jerry port implementation?") set(JERRY_EXT ON CACHE BOOL "Build jerry-ext?") -set(JERRY_LIBM ON CACHE BOOL "Build and use jerry-libm?") +set(JERRY_MATH ON CACHE BOOL "Build and use jerry-math?") set(UNITTESTS OFF CACHE BOOL "Build unit tests?") set(DOCTESTS OFF CACHE BOOL "Build doc tests?") @@ -82,21 +82,21 @@ if(JERRY_CMDLINE OR DOCTESTS) endif() if("${PLATFORM}" STREQUAL "DARWIN") - set(JERRY_LIBM OFF) + set(JERRY_MATH OFF) set(ENABLE_LTO OFF) set(ENABLE_STRIP OFF) - set(JERRY_LIBM_MESSAGE " (FORCED BY PLATFORM)") + set(JERRY_MATH_MESSAGE " (FORCED BY PLATFORM)") set(ENABLE_LTO_MESSAGE " (FORCED BY PLATFORM)") set(ENABLE_STRIP_MESSAGE " (FORCED BY PLATFORM)") endif() if("${PLATFORM}" STREQUAL "ESP-IDF") - set(JERRY_LIBM OFF) + set(JERRY_MATH OFF) set(ENABLE_LTO OFF) set(ENABLE_STRIP OFF) - set(JERRY_LIBM_MESSAGE " (FORCED BY PLATFORM)") + set(JERRY_MATH_MESSAGE " (FORCED BY PLATFORM)") set(ENABLE_LTO_MESSAGE " (FORCED BY PLATFORM)") set(ENABLE_STRIP_MESSAGE " (FORCED BY PLATFORM)") endif() @@ -108,10 +108,10 @@ if(USING_TI) endif() if(USING_MSVC) - set(JERRY_LIBM OFF) + set(JERRY_MATH OFF) set(ENABLE_STRIP OFF) - set(JERRY_LIBM_MESSAGE " (FORCED BY COMPILER)") + set(JERRY_MATH_MESSAGE " (FORCED BY COMPILER)") set(ENABLE_STRIP_MESSAGE " (FORCED BY COMPILER)") endif() @@ -136,7 +136,7 @@ message(STATUS "JERRY_CMDLINE_SNAPSHOT " ${JERRY_CMDLINE_SNAPSHOT} ${JER message(STATUS "JERRY_LIBFUZZER " ${JERRY_LIBFUZZER} ${JERRY_LIBFUZZER_MESSAGE}) message(STATUS "JERRY_PORT_DEFAULT " ${JERRY_PORT_DEFAULT} ${JERRY_PORT_DEFAULT_MESSAGE}) message(STATUS "JERRY_EXT " ${JERRY_EXT} ${JERRY_EXT_MESSAGE}) -message(STATUS "JERRY_LIBM " ${JERRY_LIBM} ${JERRY_LIBM_MESSAGE}) +message(STATUS "JERRY_MATH " ${JERRY_MATH} ${JERRY_MATH_MESSAGE}) message(STATUS "UNITTESTS " ${UNITTESTS}) message(STATUS "DOCTESTS " ${DOCTESTS}) @@ -257,8 +257,8 @@ endif() add_custom_target(generate-single-source) # Jerry's libm -if(JERRY_LIBM) - add_subdirectory(jerry-libm) +if(JERRY_MATH) + add_subdirectory(jerry-math) endif() # Jerry's core @@ -282,8 +282,8 @@ endif() # Unittests if(UNITTESTS) add_subdirectory(tests/unit-core) - if(JERRY_LIBM) - add_subdirectory(tests/unit-libm) + if(JERRY_MATH) + add_subdirectory(tests/unit-math) endif() if(JERRY_EXT) add_subdirectory(tests/unit-ext) diff --git a/docs/01.CONFIGURATION.md b/docs/01.CONFIGURATION.md index 57c32155e..962a69c44 100644 --- a/docs/01.CONFIGURATION.md +++ b/docs/01.CONFIGURATION.md @@ -286,7 +286,7 @@ a set of files into the `gen_src` directory (Note that the command is executed i but can be adapted to run outside of the project root dir): ```sh -$ python tools/srcgenerator.py --output-dir gen_src --jerry-core --jerry-port-default --jerry-libm +$ python tools/srcgenerator.py --output-dir gen_src --jerry-core --jerry-port-default --jerry-math ``` The command creates the following files in the `gen_src` dir: @@ -296,7 +296,7 @@ The command creates the following files in the `gen_src` dir: * `jerryscript-config.h` * `jerryscript-port-default.c` * `jerryscript-port-default.h` -* `jerryscript-libm.c` +* `jerryscript-math.c` * `math.h` **Important**: the `jerryscript-config.h` contains the configurations mentioned above and @@ -307,7 +307,7 @@ These files can be directly compiled with an application using the JerryScript A For example with the following command: ```sh -$ gcc -Wall -o demo_app demo_app.c gen_src/jerryscript.c gen_src/jerryscript-port-default.c jerryscript-libm.c -Igen_src/ +$ gcc -Wall -o demo_app demo_app.c gen_src/jerryscript.c gen_src/jerryscript-port-default.c jerryscript-math.c -Igen_src/ ``` Please note that the headers must be available on the include path. diff --git a/docs/03.API-EXAMPLE.md b/docs/03.API-EXAMPLE.md index b6c3c633f..e38c7c9f3 100644 --- a/docs/03.API-EXAMPLE.md +++ b/docs/03.API-EXAMPLE.md @@ -32,7 +32,7 @@ $ export PKG_CONFIG_PATH=$(pwd)/example_install/lib/pkgconfig/ Test if the `pkg-config` works for JerryScript: ```sh -$ pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-ext libjerry-libm +$ pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-ext libjerry-math ``` ## Example 1. Execute JavaScript from your application @@ -58,7 +58,7 @@ main (void) To compile it one can use the following command: ```sh -$ gcc api-example-1.c -o api-example-1 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-libm) +$ gcc api-example-1.c -o api-example-1 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-math) ``` If everything is correct the application returns with a zero exit code: @@ -118,7 +118,7 @@ main (void) To compile it one can use the following command: ```sh -$ gcc api-example-2.c -o api-example-2 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-libm) +$ gcc api-example-2.c -o api-example-2 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-math) ``` If everything is correct the application returns with a zero exit code: @@ -181,7 +181,7 @@ main (void) To compile it one can use the following command: ```sh -$ gcc api-example-3.c -o api-example-3 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-libm) +$ gcc api-example-3.c -o api-example-3 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-math) ``` If everything is correct the application returns with a zero exit code: @@ -285,7 +285,7 @@ main (void) To compile it one can use the following command: ```sh -$ gcc api-example-4.c -o api-example-4 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-libm) +$ gcc api-example-4.c -o api-example-4 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-math) ``` If everything is correct the application should print out the message present in the `print_handler` method: @@ -405,7 +405,7 @@ main (void) To compile it one can use the following command: ```sh -$ gcc api-example-5.c -o api-example-5 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-libm) +$ gcc api-example-5.c -o api-example-5 $(pkg-config --cflags --libs libjerry-core libjerry-port-default libjerry-math) ``` If everything is correct the application should print out the string passed for the `print` method in the JS code: @@ -473,7 +473,7 @@ To compile it one can use the following command: (**Note** that the `libjerry-ext` was added **before** the `libjerry-port-default` entry for the `pkg-config` call. ```sh -$ gcc api-example-6.c -o api-example-6 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-libm) +$ gcc api-example-6.c -o api-example-6 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-math) ``` If everything is correct the application should print out the string passed for the `print` method in the JS code: @@ -549,7 +549,7 @@ To compile it one can use the following command: (**Note** that the `libjerry-ext` was added **before** the `libjerry-port-default` entry for the `pkg-config` call. ```sh -$ gcc api-example-7.c -o api-example-7 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-libm) +$ gcc api-example-7.c -o api-example-7 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-math) ``` The sample will output 'Hello from C!'. However, now it is not just a part of the source script, but the value, dynamically supplied to the engine: @@ -822,7 +822,7 @@ To compile it one can use the following command: (**Note** that the `libjerry-ext` was added **before** the `libjerry-port-default` entry for the `pkg-config` call. ```sh -$ gcc api-example-8-shell.c -o api-example-8-shell $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-libm) +$ gcc api-example-8-shell.c -o api-example-8-shell $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-math) ``` The application reads lines from standard input and evaluates them, one after another. To try out run: @@ -922,7 +922,7 @@ To compile it one can use the following command: (**Note** that the `libjerry-ext` was added **before** the `libjerry-port-default` entry for the `pkg-config` call. ```sh -$ gcc api-example-9.c -o api-example-9 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-libm) +$ gcc api-example-9.c -o api-example-9 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-math) ``` Execute the example with: @@ -1053,7 +1053,7 @@ To compile it one can use the following command: (**Note** that the `libjerry-ext` was added **before** the `libjerry-port-default` entry for the `pkg-config` call. ```sh -$ gcc api-example-10.c -o api-example-10 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-libm) +$ gcc api-example-10.c -o api-example-10 $(pkg-config --cflags --libs libjerry-core libjerry-ext libjerry-port-default libjerry-math) ``` Execute the example with: diff --git a/jerry-core/CMakeLists.txt b/jerry-core/CMakeLists.txt index 91471ad6f..76ff13543 100644 --- a/jerry-core/CMakeLists.txt +++ b/jerry-core/CMakeLists.txt @@ -410,9 +410,9 @@ if(ENABLE_LTO) set(JERRY_CORE_PKGCONFIG_CFLAGS "${JERRY_CORE_PKGCONFIG_CFLAGS} -flto") endif() -if(JERRY_LIBM) - target_link_libraries(${JERRY_CORE_NAME} jerry-libm) - set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-libm) +if(JERRY_MATH) + target_link_libraries(${JERRY_CORE_NAME} jerry-math) + set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-math) endif() separate_arguments(EXTERNAL_LINK_LIBS) diff --git a/jerry-libm/CMakeLists.txt b/jerry-math/CMakeLists.txt similarity index 54% rename from jerry-libm/CMakeLists.txt rename to jerry-math/CMakeLists.txt index 7f6356a50..5df553074 100644 --- a/jerry-libm/CMakeLists.txt +++ b/jerry-math/CMakeLists.txt @@ -13,55 +13,55 @@ # limitations under the License. cmake_minimum_required (VERSION 2.8.12) -set(JERRY_LIBM_NAME jerry-libm) -project (${JERRY_LIBM_NAME} C) +set(JERRY_MATH_NAME jerry-math) +project (${JERRY_MATH_NAME} C) # Compiler / linker flags # TODO: Reduce the below list of warning/error disablings as much as possible -set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-error=sign-compare") -set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-error=sign-conversion") -set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-sign-conversion") -set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-sign-compare") -set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-strict-aliasing") +set(COMPILE_FLAGS_MATH "${COMPILE_FLAGS_MATH} -Wno-error=sign-compare") +set(COMPILE_FLAGS_MATH "${COMPILE_FLAGS_MATH} -Wno-error=sign-conversion") +set(COMPILE_FLAGS_MATH "${COMPILE_FLAGS_MATH} -Wno-sign-conversion") +set(COMPILE_FLAGS_MATH "${COMPILE_FLAGS_MATH} -Wno-sign-compare") +set(COMPILE_FLAGS_MATH "${COMPILE_FLAGS_MATH} -Wno-strict-aliasing") # Include directories -set(INCLUDE_LIBM "${CMAKE_CURRENT_SOURCE_DIR}/include") +set(INCLUDE_MATH "${CMAKE_CURRENT_SOURCE_DIR}/include") # Source directories -file(GLOB SOURCE_LIBM *.c) +file(GLOB SOURCE_MATH *.c) # "Single" JerryScript libm source/header build. # The process will create the following files: -# * jerryscript-libm.c +# * jerryscript-math.c # * math.h if(ENABLE_ALL_IN_ONE_SOURCE) - file(GLOB HEADER_LIBM *.h) - set(ALL_IN_FILE "${CMAKE_BINARY_DIR}/src/jerryscript-libm.c") + file(GLOB HEADER_MATH *.h) + set(ALL_IN_FILE "${CMAKE_BINARY_DIR}/src/jerryscript-math.c") set(ALL_IN_FILE_H "${CMAKE_BINARY_DIR}/src/math.h") add_custom_command(OUTPUT ${ALL_IN_FILE} ${ALL_IN_FILE_H} ${JERRYSCRIPT_CONFIG_H} COMMAND python ${CMAKE_SOURCE_DIR}/tools/srcgenerator.py - --jerry-libm + --jerry-math --output-dir ${CMAKE_BINARY_DIR}/src - DEPENDS ${SOURCE_LIBM} - ${HEADER_LIBM} + DEPENDS ${SOURCE_MATH} + ${HEADER_MATH} ${CMAKE_SOURCE_DIR}/tools/srcgenerator.py ${CMAKE_SOURCE_DIR}/tools/srcmerger.py ) - add_custom_target(generate-single-source-libm DEPENDS ${ALL_IN_FILE} ${ALL_IN_FILE_H}) - add_dependencies(generate-single-source generate-single-source-libm) + add_custom_target(generate-single-source-math DEPENDS ${ALL_IN_FILE} ${ALL_IN_FILE_H}) + add_dependencies(generate-single-source generate-single-source-math) - set(SOURCE_LIBM ${ALL_IN_FILE} ${ALL_IN_FILE_H}) + set(SOURCE_MATH ${ALL_IN_FILE} ${ALL_IN_FILE_H}) endif() -add_library(${JERRY_LIBM_NAME} ${SOURCE_LIBM}) -set_property(TARGET ${JERRY_LIBM_NAME} - PROPERTY COMPILE_FLAGS "${COMPILE_FLAGS_LIBM}") +add_library(${JERRY_MATH_NAME} ${SOURCE_MATH}) +set_property(TARGET ${JERRY_MATH_NAME} + PROPERTY COMPILE_FLAGS "${COMPILE_FLAGS_MATH}") -target_include_directories(${JERRY_LIBM_NAME} PUBLIC ${INCLUDE_LIBM}) +target_include_directories(${JERRY_MATH_NAME} PUBLIC ${INCLUDE_MATH}) -configure_file(libjerry-libm.pc.in libjerry-libm.pc @ONLY) +configure_file(libjerry-math.pc.in libjerry-math.pc @ONLY) -install(TARGETS ${JERRY_LIBM_NAME} DESTINATION lib) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libjerry-libm.pc DESTINATION lib/pkgconfig) -install(DIRECTORY ${INCLUDE_LIBM}/ DESTINATION include/jerryscript-libm) +install(TARGETS ${JERRY_MATH_NAME} DESTINATION lib) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libjerry-math.pc DESTINATION lib/pkgconfig) +install(DIRECTORY ${INCLUDE_MATH}/ DESTINATION include/jerryscript-math) diff --git a/jerry-libm/acos.c b/jerry-math/acos.c similarity index 99% rename from jerry-libm/acos.c rename to jerry-math/acos.c index 14e6ded4b..7a44b9510 100644 --- a/jerry-libm/acos.c +++ b/jerry-math/acos.c @@ -25,7 +25,7 @@ * @(#)e_acos.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* acos(x) * diff --git a/jerry-libm/acosh.c b/jerry-math/acosh.c similarity index 98% rename from jerry-libm/acosh.c rename to jerry-math/acosh.c index 7201f4f2b..9396e9aca 100644 --- a/jerry-libm/acosh.c +++ b/jerry-math/acosh.c @@ -25,7 +25,7 @@ * @(#)e_acosh.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* acosh(x) * Method : diff --git a/jerry-libm/asin.c b/jerry-math/asin.c similarity index 99% rename from jerry-libm/asin.c rename to jerry-math/asin.c index 2c70db522..6edcb8dc9 100644 --- a/jerry-libm/asin.c +++ b/jerry-math/asin.c @@ -25,7 +25,7 @@ * @(#)e_asin.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* asin(x) * diff --git a/jerry-libm/asinh.c b/jerry-math/asinh.c similarity index 98% rename from jerry-libm/asinh.c rename to jerry-math/asinh.c index 17edbec75..67a8dd78f 100644 --- a/jerry-libm/asinh.c +++ b/jerry-math/asinh.c @@ -25,7 +25,7 @@ * @(#)s_asinh.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* asinh(x) * Method : diff --git a/jerry-libm/atan.c b/jerry-math/atan.c similarity index 99% rename from jerry-libm/atan.c rename to jerry-math/atan.c index 586b787d0..8662a539c 100644 --- a/jerry-libm/atan.c +++ b/jerry-math/atan.c @@ -25,7 +25,7 @@ * @(#)s_atan.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* atan(x) * diff --git a/jerry-libm/atan2.c b/jerry-math/atan2.c similarity index 99% rename from jerry-libm/atan2.c rename to jerry-math/atan2.c index 5f9eb1373..8de18dddb 100644 --- a/jerry-libm/atan2.c +++ b/jerry-math/atan2.c @@ -25,7 +25,7 @@ * @(#)e_atan2.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* atan2(y,x) * diff --git a/jerry-libm/atanh.c b/jerry-math/atanh.c similarity index 98% rename from jerry-libm/atanh.c rename to jerry-math/atanh.c index ee6eb0cb0..76289daae 100644 --- a/jerry-libm/atanh.c +++ b/jerry-math/atanh.c @@ -25,7 +25,7 @@ * @(#)e_atanh.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* atanh(x) * Method : diff --git a/jerry-libm/cbrt.c b/jerry-math/cbrt.c similarity index 98% rename from jerry-libm/cbrt.c rename to jerry-math/cbrt.c index cedb2a9d8..9d6e5ced4 100644 --- a/jerry-libm/cbrt.c +++ b/jerry-math/cbrt.c @@ -25,7 +25,7 @@ * @(#)s_cbrt.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* cbrt(x) * Return cube root of x diff --git a/jerry-libm/ceil.c b/jerry-math/ceil.c similarity index 98% rename from jerry-libm/ceil.c rename to jerry-math/ceil.c index 578cb62c3..0a69a715f 100644 --- a/jerry-libm/ceil.c +++ b/jerry-math/ceil.c @@ -25,7 +25,7 @@ * @(#)s_ceil.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* ceil(x) * Return x rounded toward -inf to integral value diff --git a/jerry-libm/copysign.c b/jerry-math/copysign.c similarity index 97% rename from jerry-libm/copysign.c rename to jerry-math/copysign.c index 23e209a49..f4143090a 100644 --- a/jerry-libm/copysign.c +++ b/jerry-math/copysign.c @@ -25,7 +25,7 @@ * @(#)s_copysign.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* copysign(x,y) returns a value with the magnitude of x and * with the sign bit of y. diff --git a/jerry-libm/cosh.c b/jerry-math/cosh.c similarity index 98% rename from jerry-libm/cosh.c rename to jerry-math/cosh.c index c21297b9b..82723129f 100644 --- a/jerry-libm/cosh.c +++ b/jerry-math/cosh.c @@ -25,7 +25,7 @@ * @(#)e_cosh.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* cosh(x) * Method: diff --git a/jerry-libm/exp.c b/jerry-math/exp.c similarity index 99% rename from jerry-libm/exp.c rename to jerry-math/exp.c index 201dd02d8..5c4c28dff 100644 --- a/jerry-libm/exp.c +++ b/jerry-math/exp.c @@ -24,7 +24,7 @@ * @(#)e_exp.c 1.6 04/04/22 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* exp(x) * Returns the exponential of x. diff --git a/jerry-libm/expm1.c b/jerry-math/expm1.c similarity index 99% rename from jerry-libm/expm1.c rename to jerry-math/expm1.c index e23f1ad75..f82841550 100644 --- a/jerry-libm/expm1.c +++ b/jerry-math/expm1.c @@ -24,7 +24,7 @@ * @(#)s_expm1.c 5.1 93/09/24 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* expm1(x) * Returns exp(x)-1, the exponential of x minus 1. diff --git a/jerry-libm/fabs.c b/jerry-math/fabs.c similarity index 97% rename from jerry-libm/fabs.c rename to jerry-math/fabs.c index 6364d02a5..45624e0d2 100644 --- a/jerry-libm/fabs.c +++ b/jerry-math/fabs.c @@ -25,7 +25,7 @@ * @(#)s_fabs.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* fabs(x) returns the absolute value of x. */ diff --git a/jerry-libm/finite.c b/jerry-math/finite.c similarity index 97% rename from jerry-libm/finite.c rename to jerry-math/finite.c index dfe628e6f..f1a8dad2e 100644 --- a/jerry-libm/finite.c +++ b/jerry-math/finite.c @@ -25,7 +25,7 @@ * @(#)s_finite.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* finite(x) returns 1 is x is finite, else 0; * no branching! diff --git a/jerry-libm/floor.c b/jerry-math/floor.c similarity index 98% rename from jerry-libm/floor.c rename to jerry-math/floor.c index ade7921d8..2b11482f1 100644 --- a/jerry-libm/floor.c +++ b/jerry-math/floor.c @@ -25,7 +25,7 @@ * @(#)s_floor.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* floor(x) * Return x rounded toward -inf to integral value diff --git a/jerry-libm/fmod.c b/jerry-math/fmod.c similarity index 99% rename from jerry-libm/fmod.c rename to jerry-math/fmod.c index 0c335e450..f13753015 100644 --- a/jerry-libm/fmod.c +++ b/jerry-math/fmod.c @@ -25,7 +25,7 @@ * @(#)e_fmod.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* fmod(x,y) * Return x mod y in exact arithmetic diff --git a/jerry-libm/include/math.h b/jerry-math/include/math.h similarity index 96% rename from jerry-libm/include/math.h rename to jerry-math/include/math.h index 9a0a682f7..f6aaab927 100644 --- a/jerry-libm/include/math.h +++ b/jerry-math/include/math.h @@ -13,8 +13,8 @@ * limitations under the License. */ -#ifndef JERRY_LIBM_MATH_H -#define JERRY_LIBM_MATH_H +#ifndef JERRY_MATH_H +#define JERRY_MATH_H #ifdef __cplusplus extern "C" @@ -92,4 +92,4 @@ double nextafter (double, double); #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* !JERRY_LIBM_MATH_H */ +#endif /* !JERRY_MATH_H */ diff --git a/jerry-libm/isnan.c b/jerry-math/isnan.c similarity index 97% rename from jerry-libm/isnan.c rename to jerry-math/isnan.c index 08b967ae5..723653c12 100644 --- a/jerry-libm/isnan.c +++ b/jerry-math/isnan.c @@ -25,7 +25,7 @@ * @(#)s_isnan.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* isnan(x) returns 1 is x is nan, else 0; * no branching! diff --git a/jerry-libm/jerry-libm-internal.h b/jerry-math/jerry-math-internal.h similarity index 97% rename from jerry-libm/jerry-libm-internal.h rename to jerry-math/jerry-math-internal.h index d03e63d58..f22a66dab 100644 --- a/jerry-libm/jerry-libm-internal.h +++ b/jerry-math/jerry-math-internal.h @@ -24,8 +24,8 @@ * @(#)fdlibm.h 1.5 04/04/22 */ -#ifndef JERRY_LIBM_INTERNAL_H -#define JERRY_LIBM_INTERNAL_H +#ifndef JERRY_MATH_INTERNAL_H +#define JERRY_MATH_INTERNAL_H /* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly but these catch some common cases. */ @@ -123,4 +123,4 @@ double nextafter (double x, double y); double copysign (double x, double y); double scalbn (double x, int n); -#endif /* !JERRY_LIBM_INTERNAL_H */ +#endif /* !JERRY_MATH_INTERNAL_H */ diff --git a/jerry-libm/libjerry-libm.pc.in b/jerry-math/libjerry-math.pc.in similarity index 72% rename from jerry-libm/libjerry-libm.pc.in rename to jerry-math/libjerry-math.pc.in index 2d6bd27b9..662f6a78c 100644 --- a/jerry-libm/libjerry-libm.pc.in +++ b/jerry-math/libjerry-math.pc.in @@ -1,10 +1,10 @@ prefix=@CMAKE_INSTALL_PREFIX@ libdir=${prefix}/lib -includedir=${prefix}/include/jerry-libm +includedir=${prefix}/include/jerry-math -Name: libjerry-libm +Name: libjerry-math Description: JerryScript: lightweight JavaScript engine (minimal math library) URL: https://github.com/jerryscript-project/jerryscript Version: @JERRY_VERSION@ -Libs: -L${libdir} -ljerry-libm +Libs: -L${libdir} -ljerry-math Cflags: -I${includedir} diff --git a/jerry-libm/log.c b/jerry-math/log.c similarity index 99% rename from jerry-libm/log.c rename to jerry-math/log.c index ed7152ac7..fb2053f6d 100644 --- a/jerry-libm/log.c +++ b/jerry-math/log.c @@ -25,7 +25,7 @@ * @(#)e_log.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* log(x) * Return the logrithm of x diff --git a/jerry-libm/log10.c b/jerry-math/log10.c similarity index 99% rename from jerry-libm/log10.c rename to jerry-math/log10.c index d8de89a99..435c00cc9 100644 --- a/jerry-libm/log10.c +++ b/jerry-math/log10.c @@ -25,7 +25,7 @@ * @(#)e_log10.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* log10(x) * Return the base 10 logarithm of x diff --git a/jerry-libm/log1p.c b/jerry-math/log1p.c similarity index 99% rename from jerry-libm/log1p.c rename to jerry-math/log1p.c index a7e7c64be..c76631c50 100644 --- a/jerry-libm/log1p.c +++ b/jerry-math/log1p.c @@ -24,7 +24,7 @@ * @(#)s_log1p.c 5.1 93/09/24 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* log1p(x) * Method : diff --git a/jerry-libm/log2.c b/jerry-math/log2.c similarity index 99% rename from jerry-libm/log2.c rename to jerry-math/log2.c index 841048bd8..19860fa29 100644 --- a/jerry-libm/log2.c +++ b/jerry-math/log2.c @@ -25,7 +25,7 @@ * @(#)e_log2.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* log2(x) * Return the base 2 logarithm of x. See e_log.c and k_log.h for most diff --git a/jerry-libm/nextafter.c b/jerry-math/nextafter.c similarity index 98% rename from jerry-libm/nextafter.c rename to jerry-math/nextafter.c index f9473d5a7..cd11c2e30 100644 --- a/jerry-libm/nextafter.c +++ b/jerry-math/nextafter.c @@ -25,7 +25,7 @@ * @(#)s_nextafter.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" double nextafter (double x, diff --git a/jerry-libm/pow.c b/jerry-math/pow.c similarity index 99% rename from jerry-libm/pow.c rename to jerry-math/pow.c index a33b9b8f7..7865d2b59 100644 --- a/jerry-libm/pow.c +++ b/jerry-math/pow.c @@ -24,7 +24,7 @@ * @(#)e_pow.c 1.5 04/04/22 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* pow(x,y) return x**y * diff --git a/jerry-libm/scalbn.c b/jerry-math/scalbn.c similarity index 98% rename from jerry-libm/scalbn.c rename to jerry-math/scalbn.c index 4c61b5af0..41dabbd29 100644 --- a/jerry-libm/scalbn.c +++ b/jerry-math/scalbn.c @@ -25,7 +25,7 @@ * @(#)s_scalbn.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* scalbn(x,n) returns x* 2**n computed by exponent * manipulation rather than by actually performing an diff --git a/jerry-libm/sinh.c b/jerry-math/sinh.c similarity index 98% rename from jerry-libm/sinh.c rename to jerry-math/sinh.c index 5439c3a5d..a3ca3981c 100644 --- a/jerry-libm/sinh.c +++ b/jerry-math/sinh.c @@ -25,7 +25,7 @@ * @(#)e_sinh.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* __sinh(x) * Method: diff --git a/jerry-libm/sqrt.c b/jerry-math/sqrt.c similarity index 99% rename from jerry-libm/sqrt.c rename to jerry-math/sqrt.c index cdd548871..320e3218f 100644 --- a/jerry-libm/sqrt.c +++ b/jerry-math/sqrt.c @@ -25,7 +25,7 @@ * @(#)e_sqrt.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* sqrt(x) * Return correctly rounded sqrt. diff --git a/jerry-libm/tanh.c b/jerry-math/tanh.c similarity index 98% rename from jerry-libm/tanh.c rename to jerry-math/tanh.c index b7ab527f5..7f5d3ea73 100644 --- a/jerry-libm/tanh.c +++ b/jerry-math/tanh.c @@ -25,7 +25,7 @@ * @(#)s_tanh.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" /* tanh(x) * Return the Hyperbolic Tangent of x diff --git a/jerry-libm/trig.c b/jerry-math/trig.c similarity index 99% rename from jerry-libm/trig.c rename to jerry-math/trig.c index 4211571e0..63d63bac3 100644 --- a/jerry-libm/trig.c +++ b/jerry-math/trig.c @@ -32,7 +32,7 @@ * @(#)s_tan.c 1.3 95/01/18 */ -#include "jerry-libm-internal.h" +#include "jerry-math-internal.h" #define zero 0.00000000000000000000e+00 /* 0x00000000, 0x00000000 */ #define half 5.00000000000000000000e-01 /* 0x3FE00000, 0x00000000 */ diff --git a/targets/curie_bsp/setup.py b/targets/curie_bsp/setup.py index d8b7b1ca9..4ef79bc6e 100755 --- a/targets/curie_bsp/setup.py +++ b/targets/curie_bsp/setup.py @@ -76,7 +76,7 @@ def build_jerry_data(jerry_path): """ jerry_sources = [] jerry_dirs = set() - for sub_dir in ['jerry-core', 'jerry-libm', os.path.join('targets', 'curie_bsp', 'source')]: + for sub_dir in ['jerry-core', 'jerry-math', os.path.join('targets', 'curie_bsp', 'source')]: for file in find_sources(os.path.normpath(jerry_path), sub_dir): path = os.path.join('jerryscript', file) jerry_sources.append(path) @@ -198,7 +198,7 @@ def create_quark_kbuild(project_path, jerry_path): quark_include_paths = [ 'include', 'jerryscript', - os.path.join('jerryscript', 'jerry-libm', 'include'), + os.path.join('jerryscript', 'jerry-math', 'include'), os.path.join('jerryscript', 'targets' ,'curie_bsp', 'include') ] + list(jerry_data['dirs']) diff --git a/targets/esp-idf/README.md b/targets/esp-idf/README.md index da9fb20b0..cbe683145 100644 --- a/targets/esp-idf/README.md +++ b/targets/esp-idf/README.md @@ -1,15 +1,15 @@ -This is a port for espressif's esp-idf (esp32). The LIBM, LTO and STRIP options should be disabled, so to build under the IDF toolchain, just run the following command +This is a port for espressif's esp-idf (esp32). The MATH, LTO and STRIP options should be disabled, so to build under the IDF toolchain, just run the following command ``` -python tools\build.py --toolchain=cmake/toolchain-esp32.cmake --cmake-param "-GUnix Makefiles" --jerry-cmdline=OFF --jerry-port-default=OFF --jerry-libm=OFF --lto=OFF --strip=OFF +python tools\build.py --toolchain=cmake/toolchain-esp32.cmake --cmake-param "-GUnix Makefiles" --jerry-cmdline=OFF --jerry-port-default=OFF --jerry-math=OFF --lto=OFF --strip=OFF ``` -NB: the LIBM, STRIP and LTO might be disabled by platform as well. I strongly suggest limiting heap memorry with '--mem-heap=128' but that really depends on the SRAM avaiulable on your esp32. +NB: the MATH, STRIP and LTO might be disabled by platform as well. I strongly suggest limiting heap memorry with '--mem-heap=128' but that really depends on the SRAM avaiulable on your esp32. Then copy the artefacts 'build/lib/\*.a' in an esp-idf component named 'jerryscript' (eg) and use a 'CMakeLists.txt' like this one ``` -# assumes there is a component with this the following +# assumes there is a component with this the following # - set the JERRY_DIR wherever the jerryscript source code (the include files) is # - a "lib" directory with the 2 libraries below diff --git a/targets/esp8266/Makefile b/targets/esp8266/Makefile index 915f6be72..5ba77e0e1 100644 --- a/targets/esp8266/Makefile +++ b/targets/esp8266/Makefile @@ -104,7 +104,7 @@ LINKFLAGS_eagle.app.v6 = \ -lwps \ -L./libs \ -ljerry-core \ - -ljerry-libm \ + -ljerry-math \ $(DEP_LIBS_eagle.app.v6) \ -Wl,--end-group @@ -113,7 +113,7 @@ DEPENDS_eagle.app.v6 = \ $(LDDIR)/eagle.rom.addr.v6.ld \ ./include/jerry-targetjs.h \ ./libs/libjerry-core.a \ - ./libs/libjerry-libm.a + ./libs/libjerry-math.a ############################################################# diff --git a/targets/esp8266/Makefile.esp8266 b/targets/esp8266/Makefile.esp8266 index c0f88c531..c9867c8d8 100644 --- a/targets/esp8266/Makefile.esp8266 +++ b/targets/esp8266/Makefile.esp8266 @@ -55,9 +55,9 @@ jerry: -DEXTERNAL_COMPILE_FLAGS="$(ESP_CFLAGS)" \ -DJERRY_GLOBAL_HEAP_SIZE=$(JERRYHEAP) - make -C$(BUILD_DIR) jerry-core jerry-libm + make -C$(BUILD_DIR) jerry-core jerry-math cp $(BUILD_DIR)/lib/libjerry-core.a $(COPYTARGET)/ - cp $(BUILD_DIR)/lib/libjerry-libm.a $(COPYTARGET)/ + cp $(BUILD_DIR)/lib/libjerry-math.a $(COPYTARGET)/ js2c: tools/js2c.py --dest targets/esp8266/include --js-source targets/esp8266/js diff --git a/targets/mbedos5/template-mbedignore.txt b/targets/mbedos5/template-mbedignore.txt index f6c45e65f..4d7953713 100644 --- a/targets/mbedos5/template-mbedignore.txt +++ b/targets/mbedos5/template-mbedignore.txt @@ -1,7 +1,7 @@ cmake/* docs/* -jerry-libm/* jerry-main/* +jerry-math/* jerry-port/default/default-date.c jerry-port/default/default-io.c targets/* diff --git a/targets/nuttx-stm32f4/Makefile b/targets/nuttx-stm32f4/Makefile index 098e16075..c63b9a0a4 100644 --- a/targets/nuttx-stm32f4/Makefile +++ b/targets/nuttx-stm32f4/Makefile @@ -30,10 +30,10 @@ JERRYSCRIPT_ROOT_DIR ?= ../../../jerryscript CFLAGS += -std=c99 CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-core/include CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-ext/include -CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-libm/include +CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-math/include # These libs should be copied from the JerryScript project. -LIBS = libjerry-core.a libjerry-ext.a libjerry-libm.a +LIBS = libjerry-core.a libjerry-ext.a libjerry-math.a APPNAME = jerry ASRCS = setjmp.S diff --git a/targets/nuttx-stm32f4/Makefile.travis b/targets/nuttx-stm32f4/Makefile.travis index 792030b68..8da37f7e9 100644 --- a/targets/nuttx-stm32f4/Makefile.travis +++ b/targets/nuttx-stm32f4/Makefile.travis @@ -51,7 +51,7 @@ install: install-apt-get-deps install-noapt # Build JerryScript. script-build-jerryscript: - tools/build.py --clean --toolchain cmake/toolchain_mcu_stm32f4.cmake --profile=es.next --jerry-cmdline OFF --lto OFF --jerry-libm ON --all-in-one ON --jerry-port-default OFF --mem-heap 70 --compile-flag='--sysroot=../nuttx' + tools/build.py --clean --toolchain cmake/toolchain_mcu_stm32f4.cmake --profile=es.next --jerry-cmdline OFF --lto OFF --jerry-math ON --all-in-one ON --jerry-port-default OFF --mem-heap 70 --compile-flag='--sysroot=../nuttx' # Link in the NuttX JerryScript target directory under the NuttX apps tree. script-add-jerryscript-app: diff --git a/targets/nuttx-stm32f4/README.md b/targets/nuttx-stm32f4/README.md index e4d490269..c1850c830 100644 --- a/targets/nuttx-stm32f4/README.md +++ b/targets/nuttx-stm32f4/README.md @@ -41,7 +41,7 @@ jerryscript/tools/build.py \ --clean \ --lto=OFF \ --jerry-cmdline=OFF \ - --jerry-libm=ON \ + --jerry-math=ON \ --all-in-one=ON \ --mem-heap=70 \ --profile=es.next \ diff --git a/targets/particle/Makefile.particle b/targets/particle/Makefile.particle index e8b3a2bb8..f4ec5c30e 100644 --- a/targets/particle/Makefile.particle +++ b/targets/particle/Makefile.particle @@ -45,7 +45,7 @@ jerrycore: -DCMAKE_C_COMPILER_WORKS=TRUE \ -DENABLE_LTO=ON \ -DENABLE_ALL_IN_ONE=OFF \ - -DJERRY_LIBM=OFF \ + -DJERRY_MATH=OFF \ -DJERRY_CMDLINE=OFF \ -DJERRY_PROFILE=minimal \ -DENABLE_STRIP=OFF \ diff --git a/targets/riot-stm32f4/Makefile.riot b/targets/riot-stm32f4/Makefile.riot index 1f03ff3f9..4ccc72ce8 100644 --- a/targets/riot-stm32f4/Makefile.riot +++ b/targets/riot-stm32f4/Makefile.riot @@ -47,7 +47,7 @@ libjerry: -DCMAKE_C_COMPILER_WORKS=TRUE \ -DENABLE_LTO=OFF \ -DENABLE_ALL_IN_ONE=OFF \ - -DJERRY_LIBM=OFF \ + -DJERRY_MATH=OFF \ -DJERRY_CMDLINE=OFF \ -DJERRY_PROFILE="es5.1" \ -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \ diff --git a/targets/riot-stm32f4/README.md b/targets/riot-stm32f4/README.md index 698d5cdd6..f8905b991 100644 --- a/targets/riot-stm32f4/README.md +++ b/targets/riot-stm32f4/README.md @@ -42,7 +42,7 @@ make -f ./targets/riot-stm32f4/Makefile.riot This will generate the following libraries: ``` /build/bin/release.riotstm32f4/librelease.jerry-core.a -/build/bin/release.riotstm32f4/librelease.jerry-libm.lib.a +/build/bin/release.riotstm32f4/librelease.jerry-math.lib.a ``` This will copy one library files to `targets/riot-stm32f4/bin` folder: diff --git a/targets/zephyr/README.md b/targets/zephyr/README.md index 8fed077d0..97b0072ec 100644 --- a/targets/zephyr/README.md +++ b/targets/zephyr/README.md @@ -75,7 +75,7 @@ make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101 This will generate the following libraries: ``` ./build/arduino_101/librelease-cp_minimal.jerry-core.a -./build/arduino_101/librelease-cp_minimal.jerry-libm.lib.a +./build/arduino_101/librelease-cp_minimal.jerry-math.lib.a ./build/arduino_101/librelease.external-cp_minimal-entry.a ``` diff --git a/tests/unit-libm/CMakeLists.txt b/tests/unit-math/CMakeLists.txt similarity index 88% rename from tests/unit-libm/CMakeLists.txt rename to tests/unit-math/CMakeLists.txt index 026a563a0..0d7c9da36 100644 --- a/tests/unit-libm/CMakeLists.txt +++ b/tests/unit-math/CMakeLists.txt @@ -13,13 +13,13 @@ # limitations under the License. cmake_minimum_required (VERSION 2.8.12) -project (unit-libm C) +project (unit-math C) # Unit tests main modules file(GLOB SOURCE_UNIT_TEST_MAIN_MODULES *.c) # Unit tests declaration -add_custom_target(unittests-libm) +add_custom_target(unittests-math) foreach(SOURCE_UNIT_TEST_MAIN ${SOURCE_UNIT_TEST_MAIN_MODULES}) get_filename_component(TARGET_NAME ${SOURCE_UNIT_TEST_MAIN} NAME_WE) @@ -29,7 +29,7 @@ foreach(SOURCE_UNIT_TEST_MAIN ${SOURCE_UNIT_TEST_MAIN_MODULES}) set_property(TARGET ${TARGET_NAME} PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}") set_property(TARGET ${TARGET_NAME} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests") - target_link_libraries(${TARGET_NAME} jerry-libm) + target_link_libraries(${TARGET_NAME} jerry-math) - add_dependencies(unittests-libm ${TARGET_NAME}) + add_dependencies(unittests-math ${TARGET_NAME}) endforeach() diff --git a/tests/unit-libm/test-libm.c b/tests/unit-math/test-math.c similarity index 97% rename from tests/unit-libm/test-libm.c rename to tests/unit-math/test-math.c index 9fc33bbe4..67e2e2c43 100644 --- a/tests/unit-libm/test-libm.c +++ b/tests/unit-math/test-math.c @@ -14,7 +14,7 @@ */ /** - * Unit test for jerry-libm + * Unit test for jerry-math */ #include @@ -90,7 +90,7 @@ int main (void) { #define INF INFINITY -#include "test-libm.inc.h" +#include "test-math.inc.h" return passed ? 0 : 1; } /* main */ diff --git a/tests/unit-libm/test-libm.inc.h b/tests/unit-math/test-math.inc.h similarity index 99% rename from tests/unit-libm/test-libm.inc.h rename to tests/unit-math/test-math.inc.h index 7cb03c0c1..d102ddf39 100644 --- a/tests/unit-libm/test-libm.inc.h +++ b/tests/unit-math/test-math.inc.h @@ -13,7 +13,7 @@ * limitations under the License. */ -/* This file is automatically generated by the gen-test-libm.sh script. +/* This file is automatically generated by the gen-test-math.sh script. * Do not edit! */ check_double ("acos (0.0)", acos (0.0), 1.57079632679489655800E+00); diff --git a/tools/build.py b/tools/build.py index e30f00e4a..30c076302 100755 --- a/tools/build.py +++ b/tools/build.py @@ -98,8 +98,8 @@ def get_arguments(): help=devhelp('build jerry with libfuzzer support (%(choices)s)')) compgrp.add_argument('--jerry-ext', metavar='X', choices=['ON', 'OFF'], type=str.upper, help='build jerry-ext (%(choices)s)') - compgrp.add_argument('--jerry-libm', metavar='X', choices=['ON', 'OFF'], type=str.upper, - help='build and use jerry-libm (%(choices)s)') + compgrp.add_argument('--jerry-math', metavar='X', choices=['ON', 'OFF'], type=str.upper, + help='build and use jerry-math (%(choices)s)') compgrp.add_argument('--jerry-port-default', metavar='X', choices=['ON', 'OFF'], type=str.upper, help='build default jerry port implementation (%(choices)s)') compgrp.add_argument('--unittests', metavar='X', choices=['ON', 'OFF'], type=str.upper, @@ -189,7 +189,7 @@ def generate_build_options(arguments): build_options_append('JERRY_CMDLINE_TEST', arguments.jerry_cmdline_test) build_options_append('JERRY_LIBFUZZER', arguments.libfuzzer) build_options_append('JERRY_EXT', arguments.jerry_ext) - build_options_append('JERRY_LIBM', arguments.jerry_libm) + build_options_append('JERRY_MATH', arguments.jerry_math) build_options_append('JERRY_PORT_DEFAULT', arguments.jerry_port_default) build_options_append('UNITTESTS', arguments.unittests) diff --git a/tools/check-cppcheck.sh b/tools/check-cppcheck.sh index 2f95d1ba7..bf92ebb97 100755 --- a/tools/check-cppcheck.sh +++ b/tools/check-cppcheck.sh @@ -25,11 +25,11 @@ fi JERRY_CORE_DIRS=`find jerry-core -type d` JERRY_EXT_DIRS=`find jerry-ext -type d` JERRY_PORT_DIRS=`find jerry-port -type d` -JERRY_LIBM_DIRS=`find jerry-libm -type d` +JERRY_MATH_DIRS=`find jerry-math -type d` INCLUDE_DIRS=() -for DIR in $JERRY_CORE_DIRS $JERRY_EXT_DIRS $JERRY_PORT_DIRS $JERRY_LIBM_DIRS +for DIR in $JERRY_CORE_DIRS $JERRY_EXT_DIRS $JERRY_PORT_DIRS $JERRY_MATH_DIRS do INCLUDE_DIRS=("${INCLUDE_DIRS[@]}" "-I$DIR") done @@ -44,4 +44,4 @@ cppcheck -j$CPPCHECK_JOBS --force \ --exitcode-suppressions=tools/cppcheck/suppressions-list \ --suppressions-list=tools/cppcheck/suppressions-list \ "${INCLUDE_DIRS[@]}" \ - jerry-core jerry-ext jerry-port jerry-libm jerry-main tests/unit-* + jerry-core jerry-ext jerry-port jerry-math jerry-main tests/unit-* diff --git a/tools/check-license.py b/tools/check-license.py index 46e934630..b3a2825d3 100755 --- a/tools/check-license.py +++ b/tools/check-license.py @@ -42,7 +42,7 @@ INCLUDE_DIRS = [ 'cmake', 'jerry-core', 'jerry-ext', - 'jerry-libm', + 'jerry-math', 'jerry-main', 'jerry-port', 'targets', diff --git a/tools/check-vera.sh b/tools/check-vera.sh index 0b26806de..9ce863676 100755 --- a/tools/check-vera.sh +++ b/tools/check-vera.sh @@ -17,7 +17,7 @@ JERRY_CORE_FILES=`find ./jerry-core -name "*.c" -or -name "*.h"` JERRY_EXT_FILES=`find ./jerry-ext -name "*.c" -or -name "*.h"` JERRY_PORT_FILES=`find ./jerry-port -name "*.c" -or -name "*.h"` -JERRY_LIBM_FILES=`find ./jerry-libm -name "*.c" -or -name "*.h"` +JERRY_MATH_FILES=`find ./jerry-math -name "*.c" -or -name "*.h"` JERRY_MAIN_FILES=`find ./jerry-main -name "*.c" -or -name "*.h"` UNIT_TEST_FILES=`find ./tests/unit-* -name "*.c" -or -name "*.h"` @@ -28,4 +28,4 @@ fi vera++ -r tools/vera++ -p jerry \ -e --no-duplicate \ - $MANUAL_CHECK_FILES $JERRY_CORE_FILES $JERRY_EXT_FILES $JERRY_PORT_FILES $JERRY_LIBM_FILES $JERRY_MAIN_FILES $UNIT_TEST_FILES + $MANUAL_CHECK_FILES $JERRY_CORE_FILES $JERRY_EXT_FILES $JERRY_PORT_FILES $JERRY_MATH_FILES $JERRY_MAIN_FILES $UNIT_TEST_FILES diff --git a/tools/cppcheck/suppressions-list b/tools/cppcheck/suppressions-list index d2277a83d..704648f8e 100644 --- a/tools/cppcheck/suppressions-list +++ b/tools/cppcheck/suppressions-list @@ -1,6 +1,6 @@ -wrongmathcall:tests/unit-libm/test-libm.inc.h -variableScope:jerry-libm/*.c -invalidPointerCast:jerry-libm/*.c +wrongmathcall:tests/unit-math/test-math.inc.h +variableScope:jerry-math/*.c +invalidPointerCast:jerry-math/*.c ConfigurationNotChecked:jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h ConfigurationNotChecked:jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h diff --git a/tools/gen-test-libm.sh b/tools/gen-test-math.sh similarity index 91% rename from tools/gen-test-libm.sh rename to tools/gen-test-math.sh index 64bba36e3..22f338416 100755 --- a/tools/gen-test-libm.sh +++ b/tools/gen-test-math.sh @@ -15,5 +15,5 @@ # limitations under the License. make -C tools/unit-tests build -tools/unit-tests/gen-test-libm >tests/unit-libm/test-libm.inc.h +tools/unit-tests/gen-test-math >tests/unit-math/test-math.inc.h make -C tools/unit-tests clean diff --git a/tools/run-tests.py b/tools/run-tests.py index 2c45168f7..765f42755 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -145,8 +145,8 @@ JERRY_BUILDOPTIONS = [ platform.system() != 'Linux' or (platform.machine() != 'i386' and platform.machine() != 'x86_64'), '-m32 is only supported on x86[-64]-linux') ), - Options('buildoption_test-no_jerry_libm', - ['--jerry-libm=off', '--link-lib=m'], + Options('buildoption_test-no_jerry_math', + ['--jerry-math=off', '--link-lib=m'], skip=skip_if((sys.platform == 'win32'), 'There is no separated libm on Windows')), Options('buildoption_test-no_lcache_prophashmap', ['--compile-flag=-DJERRY_LCACHE=0', '--compile-flag=-DJERRY_PROPRETY_HASHMAP=0']), diff --git a/tools/srcgenerator.py b/tools/srcgenerator.py index 96b4cbd1d..9d572909f 100644 --- a/tools/srcgenerator.py +++ b/tools/srcgenerator.py @@ -27,7 +27,7 @@ ROOT_DIR = os.path.dirname(TOOLS_DIR) SRCMERGER = os.path.join(TOOLS_DIR, 'srcmerger.py') JERRY_CORE = os.path.join(ROOT_DIR, 'jerry-core') JERRY_PORT = os.path.join(ROOT_DIR, 'jerry-port', 'default') -JERRY_LIBM = os.path.join(ROOT_DIR, 'jerry-libm') +JERRY_MATH = os.path.join(ROOT_DIR, 'jerry-math') def run_commands(*cmds, **kwargs): @@ -105,17 +105,17 @@ def generate_jerry_port_default(output_dir, verbose=False): run_commands(cmd_port_c_gen, cmd_port_h_gen, verbose=verbose) -def generate_jerry_libm(output_dir, verbose=False): - cmd_libm_c_gen = [ +def generate_jerry_math(output_dir, verbose=False): + cmd_math_c_gen = [ 'python', SRCMERGER, - '--base-dir', JERRY_LIBM, - '--output={}/jerryscript-libm.c'.format(output_dir), + '--base-dir', JERRY_MATH, + '--output={}/jerryscript-math.c'.format(output_dir), '--append-c-files', ] - run_commands(cmd_libm_c_gen, verbose=verbose) + run_commands(cmd_math_c_gen, verbose=verbose) - shutil.copyfile('{}/include/math.h'.format(JERRY_LIBM), + shutil.copyfile('{}/include/math.h'.format(JERRY_MATH), '{}/math.h'.format(output_dir)) def main(): @@ -124,8 +124,8 @@ def main(): help='Generate jerry-core files', default=False) parser.add_argument('--jerry-port-default', action='store_true', dest='jerry_port_default', help='Generate jerry-port-default files', default=False) - parser.add_argument('--jerry-libm', action='store_true', dest='jerry_libm', - help='Generate jerry-libm files', default=False) + parser.add_argument('--jerry-math', action='store_true', dest='jerry_math', + help='Generate jerry-math files', default=False) parser.add_argument('--output-dir', metavar='DIR', type=str, dest='output_dir', default='gen_src', help='Output dir') parser.add_argument('--verbose', '-v', action='store_true', default=False) @@ -146,8 +146,8 @@ def main(): if args.jerry_port_default: generate_jerry_port_default(args.output_dir, args.verbose) - if args.jerry_libm: - generate_jerry_libm(args.output_dir, args.verbose) + if args.jerry_math: + generate_jerry_math(args.output_dir, args.verbose) if __name__ == '__main__': diff --git a/tools/unit-tests/Makefile b/tools/unit-tests/Makefile index 70db6374e..435d19403 100644 --- a/tools/unit-tests/Makefile +++ b/tools/unit-tests/Makefile @@ -15,7 +15,7 @@ CC=gcc LDFLAGS=-lm -GENS=gen-test-libm +GENS=gen-test-math .PHONY: build build: $(GENS) @@ -24,5 +24,5 @@ build: $(GENS) clean: rm -f $(GENS) -gen-test-libm: gen-test-libm.c +gen-test-math: gen-test-math.c $(CC) $< -o $@ $(LDFLAGS) diff --git a/tools/unit-tests/gen-test-libm.c b/tools/unit-tests/gen-test-math.c similarity index 99% rename from tools/unit-tests/gen-test-libm.c rename to tools/unit-tests/gen-test-math.c index 3ee4f00e7..650f0ac65 100644 --- a/tools/unit-tests/gen-test-libm.c +++ b/tools/unit-tests/gen-test-math.c @@ -14,13 +14,13 @@ */ /* - * Unit test generator for jerry-libm. + * Unit test generator for jerry-math. * To be compiled separately from the rest of jerry and to be linked to a trusted libm. - * Its output should be redirected to test-libm.inc.h. + * Its output should be redirected to test-math.inc.h. * * Example: - * gcc gen-test-libm.c -o gen-test-libm -lm - * ./gen-test-libm >test-libm.inc.h + * gcc gen-test-math.c -o gen-test-math -lm + * ./gen-test-math >test-math.inc.h */ #include @@ -47,7 +47,7 @@ main (int argc, char **args) " * limitations under the License.\n" " */\n" "\n" - "/* This file is automatically generated by the gen-test-libm.sh script.\n" + "/* This file is automatically generated by the gen-test-math.sh script.\n" " * Do not edit! */\n" "\n"); @@ -311,7 +311,7 @@ main (int argc, char **args) GEN_DBL_TEST (ceil (-7.37e+19)); /* copysign tests */ - /* SKIPPED: not publicly declared in jerry-libm + /* SKIPPED: not publicly declared in jerry-math GEN_DBL_TEST (copysign (0.0, 0.0)); GEN_DBL_TEST (copysign (0.0, -0.0)); GEN_DBL_TEST (copysign (-0.0, 0.0)); @@ -443,7 +443,7 @@ main (int argc, char **args) GEN_DBL_TEST (fabs (-7.37e+19)); /* finite tests */ - /* SKIPPED: not publicly declared in jerry-libm + /* SKIPPED: not publicly declared in jerry-math GEN_INT_TEST (finite (0.0)); GEN_INT_TEST (finite (-0.0)); GEN_INT_TEST (finite (1.0)); @@ -743,7 +743,7 @@ main (int argc, char **args) GEN_DBL_TEST (pow (0.7, 1.2)); /* scalbn tests */ - /* SKIPPED: not publicly declared in jerry-libm + /* SKIPPED: not publicly declared in jerry-math GEN_DBL_TEST (scalbn (0.0, 0)); GEN_DBL_TEST (scalbn (-0.0, 0)); GEN_DBL_TEST (scalbn (0.0, 1));