Main: libm/: Remove

This commit is contained in:
Alex Kotov 2022-06-12 16:52:40 +03:00
parent 8eb2c1987f
commit 014152155e
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
18 changed files with 9 additions and 87 deletions

View File

@ -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

View File

@ -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).

View File

@ -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 <kotovalexarian@gmail.com>

View File

@ -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

View File

@ -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 `<math.h>`,
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)"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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])])

4
libm/.gitignore vendored
View File

@ -1,4 +0,0 @@
/Makefile
/Makefile.in
/include/Makefile
/include/Makefile.in

View File

@ -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

View File

@ -1 +0,0 @@
nobase_include_HEADERS = math.h

View File

@ -1,12 +0,0 @@
#ifndef _MATH_H
#define _MATH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,8 +0,0 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
__attribute__((unused))
static const int foobar = 0;

View File

@ -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