From 014152155ead457f66d16bc5c84e37288fffc0d4 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 12 Jun 2022 16:52:40 +0300 Subject: [PATCH] Main: libm/: Remove --- .github/workflows/main.yml | 2 +- CONTRIBUTING.md | 4 ++-- ChangeLog | 1 - Makefile.am | 8 -------- README.md | 6 ------ config/dev-cross-i386 | 2 +- config/dev-cross-riscv64 | 2 +- config/dev-cross-x86_64 | 2 +- config/root-cross-i386-linux | 2 +- config/root-cross-riscv64-linux | 2 +- config/root-cross-x86_64-linux | 2 +- configure.ac | 21 --------------------- libm/.gitignore | 4 ---- libm/Makefile.am | 11 ----------- libm/include/Makefile.am | 1 - libm/include/math.h | 12 ------------ libm/src/main.c | 8 -------- shared.am | 6 ------ 18 files changed, 9 insertions(+), 87 deletions(-) delete mode 100644 libm/.gitignore delete mode 100644 libm/Makefile.am delete mode 100644 libm/include/Makefile.am delete mode 100644 libm/include/math.h delete mode 100644 libm/src/main.c diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f167784a..4e57ce49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: run: sudo apt-get --yes install cppcheck - name: cppcheck source code # TODO: don't suppress "src/printf.c" - run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress='*:src/printf.c' include/ src/ libc/ libm/ + run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress='*:src/printf.c' include/ src/ libc/ - name: cppcheck examples run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=duplicateExpression --suppress=staticStringCompare examples/ - name: cppcheck tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2da558b3..b8bd197a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,8 @@ Common ------ * Add your name to [COPYING](/COPYING). -* If you change the behavior (even just fix a bug) of **libkernaux** (stable), - [libc](/libc) or [libm](/libm), add a record to [ChangeLog](/ChangeLog). +* If you change the behavior (even just fix a bug) of **libkernaux** (stable) or + [libc](/libc), add a record to [ChangeLog](/ChangeLog). diff --git a/ChangeLog b/ChangeLog index 2adf43f2..22fd86ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,6 @@ * libc/include/string.h: Add funcs "memchr", "strcat", "strncat", "strchr" * libc/include/inttypes.h: Added * libc/include/sys/types.h: Added - * libm/include/math.h: Added 2022-06-07 Alex Kotov diff --git a/Makefile.am b/Makefile.am index a920f195..fd263765 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,9 +8,6 @@ SUBDIRS = include if WITH_LIBC SUBDIRS += libc endif -if WITH_LIBM -SUBDIRS += libm -endif SUBDIRS += . @@ -20,8 +17,6 @@ endif libc/libc.la: $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libc libc.la -libm/libm.la: - $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libm libm.la lib_LTLIBRARIES = libkernaux.la @@ -55,9 +50,6 @@ endif if WITH_LIBC libkernaux_la_LIBADD += libc/libc.la endif -if WITH_LIBM -libkernaux_la_LIBADD += libm/libm.la -endif if WITH_MBR libkernaux_la_SOURCES += src/mbr.c endif diff --git a/README.md b/README.md index 0af3029d..b28ace45 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,6 @@ zero). Work-in-progress APIs can change at any time. * [vsnprintf](/examples/snprintf_va.c) * libc replacement * [ctype.h](/libc/include/ctype.h) - * [math.h](/libm/include/math.h) * [stdlib.h](/libc/include/stdlib.h) * [string.h](/libc/include/string.h) @@ -96,9 +95,7 @@ stable options. #### Features * `--enable-freestanding` - build for freestanding environment -* `--enable-split-all` - split off all libraries * `--enable-split-libc` - split off libc -* `--enable-split-libm` - split off libm * `--enable-tests` - enable usual tests and examples * `--enable-tests-all` - enable all tests * `--enable-tests-python` - enable tests that require Python 3 with YAML and @@ -108,8 +105,6 @@ stable options. * `--with-libc` - provides the replacement for some standard C functions. Useful in freestanding environment, where no libc is present. -* `--with-libm` - provides the replacement for C functions from ``, - Useful in freestanding environment, where no libm is present. ### Default options @@ -168,7 +163,6 @@ without it in `$PATH`: --host='i386-elf' \ --enable-freestanding \ --with-libc \ - --with-libm \ AR="$(which i386-elf-ar)" \ CC="$(which i386-elf-gcc)" \ RANLIB="$(which i386-elf-ranlib)" diff --git a/config/dev-cross-i386 b/config/dev-cross-i386 index c6767e99..70ecef7c 100755 --- a/config/dev-cross-i386 +++ b/config/dev-cross-i386 @@ -14,4 +14,4 @@ export AR="$CROSS-ar" export CC="$CROSS-gcc" export RANLIB="$CROSS-ranlib" -"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc --with-libm +"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc diff --git a/config/dev-cross-riscv64 b/config/dev-cross-riscv64 index b1d62fba..57b29fff 100755 --- a/config/dev-cross-riscv64 +++ b/config/dev-cross-riscv64 @@ -14,4 +14,4 @@ export AR="$CROSS-ar" export CC="$CROSS-gcc" export RANLIB="$CROSS-ranlib" -"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc --with-libm +"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc diff --git a/config/dev-cross-x86_64 b/config/dev-cross-x86_64 index 6d0df181..4a900b6d 100755 --- a/config/dev-cross-x86_64 +++ b/config/dev-cross-x86_64 @@ -16,4 +16,4 @@ export RANLIB="$CROSS-ranlib" export CFLAGS='-mabi=sysv -mcmodel=kernel -mno-80387 -mno-red-zone' -"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc --with-libm +"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc diff --git a/config/root-cross-i386-linux b/config/root-cross-i386-linux index 549fd735..7740099b 100755 --- a/config/root-cross-i386-linux +++ b/config/root-cross-i386-linux @@ -14,4 +14,4 @@ export AR="$TARGET-ar" export CC="$TARGET-gcc" export RANLIB="$TARGET-ranlib" -"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc --with-libm +"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc diff --git a/config/root-cross-riscv64-linux b/config/root-cross-riscv64-linux index a5a4c264..af99c56d 100755 --- a/config/root-cross-riscv64-linux +++ b/config/root-cross-riscv64-linux @@ -14,4 +14,4 @@ export AR="$TARGET-ar" export CC="$TARGET-gcc" export RANLIB="$TARGET-ranlib" -"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc --with-libm +"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc diff --git a/config/root-cross-x86_64-linux b/config/root-cross-x86_64-linux index 4366263b..5d8fd627 100755 --- a/config/root-cross-x86_64-linux +++ b/config/root-cross-x86_64-linux @@ -16,4 +16,4 @@ export RANLIB="$TARGET-ranlib" export CFLAGS='-mabi=sysv -mcmodel=kernel -mno-80387 -mno-red-zone' -"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc --with-libm +"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --enable-freestanding --with-libc diff --git a/configure.ac b/configure.ac index c03a3cc0..f22eb64b 100644 --- a/configure.ac +++ b/configure.ac @@ -29,8 +29,6 @@ AC_CONFIG_FILES([ include/Makefile libc/Makefile libc/include/Makefile - libm/Makefile - libm/include/Makefile include/kernaux.h include/kernaux/console.h include/kernaux/printf.h @@ -49,9 +47,7 @@ AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable - dnl Features (disabled by default) AC_ARG_ENABLE([freestanding], AS_HELP_STRING([--enable-freestanding], [build for freestanding environment])) -AC_ARG_ENABLE([split-all], AS_HELP_STRING([--enable-split-all], [split off all libraries])) AC_ARG_ENABLE([split-libc], AS_HELP_STRING([--enable-split-libc], [split off libc])) -AC_ARG_ENABLE([split-libm], AS_HELP_STRING([--enable-split-libm], [split off libm])) AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [enable usual tests and examples])) AC_ARG_ENABLE([tests-all], AS_HELP_STRING([--enable-tests-all], [enable all tests])) AC_ARG_ENABLE([tests-python], AS_HELP_STRING([--enable-tests-python], [enable tests that require Python 3 with YAML and Jinja2])) @@ -73,7 +69,6 @@ AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without m dnl Packages (disabled by default) AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement])) -AC_ARG_WITH( [libm], AS_HELP_STRING([--with-libm], [with libm replacement])) @@ -81,13 +76,6 @@ AC_ARG_WITH( [libm], AS_HELP_STRING([--with-libm], [with libm # Default args # ################ -AC_DEFUN([do_enable_split_all], -[ -if test -z "$enable_split_libc"; then enable_split_libc=yes; fi -if test -z "$enable_split_libm"; then enable_split_libm=yes; fi -]) -AS_IF([test "$enable_split_all" = yes], do_enable_split_all) - AC_DEFUN([do_enable_tests_all], [ if test -z "$enable_tests"; then enable_tests=yes; fi @@ -124,9 +112,7 @@ AS_IF([test "$enable_werror" = no ], [enable_werror=no], [enable_we dnl Features (disabled by default) AS_IF([test "$enable_freestanding" = yes], [enable_freestanding=yes], [enable_freestanding=no]) -AS_IF([test "$enable_split_all" = yes], [enable_split_all=yes], [enable_split_all=no]) AS_IF([test "$enable_split_libc" = yes], [enable_split_libc=yes], [enable_split_libc=no]) -AS_IF([test "$enable_split_libm" = yes], [enable_split_libm=yes], [enable_split_libm=no]) AS_IF([test "$enable_tests" = yes], [enable_tests=yes], [enable_tests=no]) AS_IF([test "$enable_tests_all" = yes], [enable_tests_all=yes], [enable_tests_all=no]) AS_IF([test "$enable_tests_python" = yes], [enable_tests_python=yes], [enable_tests_python=no]) @@ -148,7 +134,6 @@ AS_IF([test "$with_units" = no ], [with_units=no], [with_unit dnl Packages (disabled by default) AS_IF([test "$with_libc" = yes], [with_libc=yes], [with_libc=no]) -AS_IF([test "$with_libm" = yes], [with_libm=yes], [with_libm=no]) @@ -162,8 +147,6 @@ AS_IF([test "$enable_tests" = yes -a "$enable_freestanding" = yes], AC_MS AS_IF([test "$enable_tests_python" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests])) AS_IF([test "$enable_tests" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests])) AS_IF([test "$enable_tests_python" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests])) -AS_IF([test "$enable_tests" = yes -a "$with_libm" = yes], AC_MSG_ERROR([can not use package `libm' with tests])) -AS_IF([test "$enable_tests_python" = yes -a "$with_libm" = yes], AC_MSG_ERROR([can not use package `libm' with tests])) AS_IF([test "$with_printf" = yes -a "$with_ntoa" = no], AC_MSG_ERROR([package `printf' requires package `ntoa'])) AS_IF([test "$with_printf" = yes -a "$with_printf_fmt" = no], AC_MSG_ERROR([package `printf' requires package `printf-fmt'])) @@ -187,7 +170,6 @@ AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes]) dnl Features (disabled by default) AM_CONDITIONAL([ENABLE_FREESTANDING], [test "$enable_freestanding" = yes]) AM_CONDITIONAL([ENABLE_SPLIT_LIBC], [test "$enable_split_libc" = yes]) -AM_CONDITIONAL([ENABLE_SPLIT_LIBM], [test "$enable_split_libm" = yes]) AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = yes]) AM_CONDITIONAL([ENABLE_TESTS_PYTHON], [test "$enable_tests_python" = yes]) @@ -207,7 +189,6 @@ AM_CONDITIONAL([WITH_UNITS], [test "$with_units" = yes]) dnl Packages (disabled by default) AM_CONDITIONAL([WITH_LIBC], [test "$with_libc" = yes]) -AM_CONDITIONAL([WITH_LIBM], [test "$with_libm" = yes]) @@ -226,7 +207,6 @@ AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR], [1] dnl Features (disabled by default) AS_IF([test "$enable_split_libc" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBC], [1], [split off libc])]) -AS_IF([test "$enable_split_libm" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBM], [1], [split off libm])]) AS_IF([test "$enable_freestanding" = yes], [AC_DEFINE([ENABLE_FREESTANDING], [1], [build for freestanding environment])]) AS_IF([test "$enable_tests" = yes], [AC_DEFINE([ENABLE_TESTS], [1], [enabled usual tests and examples])]) AS_IF([test "$enable_tests_python" = yes], [AC_DEFINE([ENABLE_TESTS_PYTHON], [1], [enabled tests that require Python 3 with YAML and Jinja2])]) @@ -247,7 +227,6 @@ AS_IF([test "$with_units", = yes], [AC_DEFINE([WITH_UNITS], [1] dnl Packages (disabled by default) AS_IF([test "$with_libc" = yes], [AC_DEFINE([WITH_LIBC], [1], [with libc replacement])]) -AS_IF([test "$with_libm" = yes], [AC_DEFINE([WITH_LIBM], [1], [with libm replacement])]) diff --git a/libm/.gitignore b/libm/.gitignore deleted file mode 100644 index bda046fb..00000000 --- a/libm/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/Makefile -/Makefile.in -/include/Makefile -/include/Makefile.in diff --git a/libm/Makefile.am b/libm/Makefile.am deleted file mode 100644 index 7b44930a..00000000 --- a/libm/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -include $(top_srcdir)/shared.am - -SUBDIRS = include - -if ENABLE_SPLIT_LIBM -lib_LTLIBRARIES = libm.la -else -EXTRA_LTLIBRARIES = libm.la -endif - -libm_la_SOURCES = src/main.c diff --git a/libm/include/Makefile.am b/libm/include/Makefile.am deleted file mode 100644 index b6c12b44..00000000 --- a/libm/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -nobase_include_HEADERS = math.h diff --git a/libm/include/math.h b/libm/include/math.h deleted file mode 100644 index 17130191..00000000 --- a/libm/include/math.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _MATH_H -#define _MATH_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libm/src/main.c b/libm/src/main.c deleted file mode 100644 index 55073487..00000000 --- a/libm/src/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -__attribute__((unused)) -static const int foobar = 0; diff --git a/shared.am b/shared.am index bf730741..a64db6db 100644 --- a/shared.am +++ b/shared.am @@ -15,12 +15,6 @@ AM_CFLAGS += \ -I$(top_srcdir)/libc/include endif -if WITH_LIBM -AM_CFLAGS += \ - -I$(top_builddir)/libm/include \ - -I$(top_srcdir)/libm/include -endif - if ENABLE_WERROR AM_CFLAGS += -Werror endif