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:
+3
-3
@@ -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)
|
||||
|
||||
|
||||
@@ -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-*
|
||||
|
||||
@@ -42,7 +42,7 @@ INCLUDE_DIRS = [
|
||||
'cmake',
|
||||
'jerry-core',
|
||||
'jerry-ext',
|
||||
'jerry-libm',
|
||||
'jerry-math',
|
||||
'jerry-main',
|
||||
'jerry-port',
|
||||
'targets',
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
+2
-2
@@ -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']),
|
||||
|
||||
+11
-11
@@ -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__':
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 <math.h>
|
||||
@@ -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));
|
||||
Reference in New Issue
Block a user