Rename jerry-libm to jerry-math (#4410)
That "libm" in the name of the library resulted in awkward naming on *nix systems (`libjerry-libm.*`, "lib" occurring twice). And the name of the corresponding header is `math.h` anyway. Note that this is a breaking change in some sense. The commit contains no API change, but the build system does change for users of the math library. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
#############################################################
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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)" \
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user