1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-20 11:06:41 -05:00

Maintenance (#129)

This commit is contained in:
Alex Kotov 2022-12-04 01:44:40 +04:00 committed by GitHub
parent 081318c2c7
commit ee6172df20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 67 additions and 33 deletions

8
.gitignore vendored
View file

@ -41,7 +41,11 @@
# Custom # Custom
/Makefile.in /Makefile.in
/examples/Makefile.in
/include/Makefile.in /include/Makefile.in
/libc/Makefile.in
/libc/include/Makefile.in
/tests/Makefile.in
######################## ########################
# To build out of root # # To build out of root #
@ -98,7 +102,11 @@
# Custom # Custom
/Makefile /Makefile
/examples/Makefile
/include/Makefile /include/Makefile
/libc/Makefile
/libc/include/Makefile
/tests/Makefile
/include/kernaux.h /include/kernaux.h
/include/kernaux/multiboot2.h /include/kernaux/multiboot2.h

View file

@ -8,7 +8,7 @@ if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
ARCH='i386' ARCH='i386'
HOST="$ARCH-elf" HOST="$ARCH-elf"
TARGET='i686-linux-gnu' TARGET='i686-linux-gnu'
PREFIX="/opt/libkernaux/$ARCH" PREFIX="/opt/tailix/libkernaux/$ARCH"
export AR="$TARGET-ar" export AR="$TARGET-ar"
export CC="$TARGET-gcc" export CC="$TARGET-gcc"

View file

@ -8,7 +8,7 @@ if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
ARCH='riscv64' ARCH='riscv64'
HOST="$ARCH-elf" HOST="$ARCH-elf"
TARGET='riscv64-linux-gnu' TARGET='riscv64-linux-gnu'
PREFIX="/opt/libkernaux/$ARCH" PREFIX="/opt/tailix/libkernaux/$ARCH"
export AR="$TARGET-ar" export AR="$TARGET-ar"
export CC="$TARGET-gcc" export CC="$TARGET-gcc"

View file

@ -8,7 +8,7 @@ if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
ARCH='x86_64' ARCH='x86_64'
HOST="$ARCH-elf" HOST="$ARCH-elf"
TARGET='x86_64-linux-gnu' TARGET='x86_64-linux-gnu'
PREFIX="/opt/libkernaux/$ARCH" PREFIX="/opt/tailix/libkernaux/$ARCH"
export AR="$TARGET-ar" export AR="$TARGET-ar"
export CC="$TARGET-gcc" export CC="$TARGET-gcc"

View file

@ -54,6 +54,7 @@ AC_ARG_ENABLE([split-libc], AS_HELP_STRING([--enable-split-libc], [spl
AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable usual tests and examples])) AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable usual tests and examples]))
AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [enable all checks])) AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [enable all checks]))
AC_ARG_ENABLE([checks-cppcheck], AS_HELP_STRING([--enable-checks-cppcheck], [enable cppcheck])) AC_ARG_ENABLE([checks-cppcheck], AS_HELP_STRING([--enable-checks-cppcheck], [enable cppcheck]))
AC_ARG_ENABLE([checks-pthreads], AS_HELP_STRING([--enable-checks-pthreads], [enable tests that require pthreads]))
AC_ARG_ENABLE([checks-python], AS_HELP_STRING([--enable-checks-python], [enable tests that require Python 3 with YAML and Jinja2])) AC_ARG_ENABLE([checks-python], AS_HELP_STRING([--enable-checks-python], [enable tests that require Python 3 with YAML and Jinja2]))
dnl Packages (enabled by default) dnl Packages (enabled by default)
@ -88,6 +89,7 @@ AC_DEFUN([do_enable_checks_all],
[ [
if test -z "$enable_checks"; then enable_checks=yes; fi if test -z "$enable_checks"; then enable_checks=yes; fi
if test -z "$enable_checks_cppcheck"; then enable_checks_cppcheck=yes; fi if test -z "$enable_checks_cppcheck"; then enable_checks_cppcheck=yes; fi
if test -z "$enable_checks_pthreads"; then enable_checks_pthreads=yes; fi
if test -z "$enable_checks_python"; then enable_checks_python=yes; fi if test -z "$enable_checks_python"; then enable_checks_python=yes; fi
]) ])
AS_IF([test "$enable_checks_all" = yes], do_enable_checks_all) AS_IF([test "$enable_checks_all" = yes], do_enable_checks_all)
@ -137,6 +139,7 @@ AS_IF([test "$enable_split_libc" = yes], [enable_split_libc=yes], [ena
AS_IF([test "$enable_checks" = yes], [enable_checks=yes], [enable_checks=no]) AS_IF([test "$enable_checks" = yes], [enable_checks=yes], [enable_checks=no])
AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [enable_checks_all=no]) AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [enable_checks_all=no])
AS_IF([test "$enable_checks_cppcheck" = yes], [enable_checks_cppcheck=yes], [enable_checks_cppcheck=no]) AS_IF([test "$enable_checks_cppcheck" = yes], [enable_checks_cppcheck=yes], [enable_checks_cppcheck=no])
AS_IF([test "$enable_checks_pthreads" = yes], [enable_checks_pthreads=yes], [enable_checks_pthreads=no])
AS_IF([test "$enable_checks_python" = yes], [enable_checks_python=yes], [enable_checks_python=no]) AS_IF([test "$enable_checks_python" = yes], [enable_checks_python=yes], [enable_checks_python=no])
dnl Packages (enabled by default) dnl Packages (enabled by default)
@ -167,10 +170,8 @@ AS_IF([test "$with_libc" = yes], [with_libc=yes], [wit
# Test args # # Test args #
############# #############
AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests])) AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests]))
AS_IF([test "$enable_checks_python" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests])) AS_IF([test "$enable_checks" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests]))
AS_IF([test "$enable_checks" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests]))
AS_IF([test "$enable_checks_python" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' 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_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'])) AS_IF([test "$with_printf" = yes -a "$with_printf_fmt" = no], AC_MSG_ERROR([package `printf' requires package `printf-fmt']))
@ -200,6 +201,7 @@ AM_CONDITIONAL([ENABLE_FREESTANDING], [test "$enable_freestanding" = yes])
AM_CONDITIONAL([ENABLE_SPLIT_LIBC], [test "$enable_split_libc" = yes]) AM_CONDITIONAL([ENABLE_SPLIT_LIBC], [test "$enable_split_libc" = yes])
AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes]) AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes]) AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_PTHREADS], [test "$enable_checks_pthreads" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_PYTHON], [test "$enable_checks_python" = yes]) AM_CONDITIONAL([ENABLE_CHECKS_PYTHON], [test "$enable_checks_python" = yes])
dnl Packages (enabled by default) dnl Packages (enabled by default)
@ -250,6 +252,7 @@ AS_IF([test "$enable_split_libc" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBC],
AS_IF([test "$enable_freestanding" = yes], [AC_DEFINE([ENABLE_FREESTANDING], [1], [build for freestanding environment])]) AS_IF([test "$enable_freestanding" = yes], [AC_DEFINE([ENABLE_FREESTANDING], [1], [build for freestanding environment])])
AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS], [1], [enabled usual tests and examples])]) AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS], [1], [enabled usual tests and examples])])
AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])]) AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])])
AS_IF([test "$enable_checks_pthreads" = yes], [AC_DEFINE([ENABLE_CHECKS_PTHREADS], [1], [enabled tests that require pthreads])])
AS_IF([test "$enable_checks_python" = yes], [AC_DEFINE([ENABLE_CHECKS_PYTHON], [1], [enabled tests that require Python 3 with YAML and Jinja2])]) AS_IF([test "$enable_checks_python" = yes], [AC_DEFINE([ENABLE_CHECKS_PYTHON], [1], [enabled tests that require Python 3 with YAML and Jinja2])])
dnl Packages (enabled by default) dnl Packages (enabled by default)
@ -324,12 +327,29 @@ AM_PROG_AS
AC_PROG_CC AC_PROG_CC
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_C_INLINE AC_C_INLINE
AC_CHECK_HEADER_STDBOOL
AC_CHECK_HEADERS([stdarg.h stddef.h stdint.h]) AC_HEADER_STDBOOL
AS_IF([test "$enable_checks" = yes -a "$ac_cv_header_stdbool_h" != yes],
[AC_MSG_ERROR([the header is required])])
AC_CHECK_HEADERS([stdarg.h stddef.h stdint.h],,
[AC_MSG_ERROR([the headers are required])])
AS_IF([test "$enable_checks" = yes],
[AC_CHECK_HEADERS([assert.h setjmp.h stdio.h stdlib.h string.h],,
[AC_MSG_ERROR([the headers are required])])])
AS_IF([test "$enable_checks" = yes -a "$enable_checks_pthreads" = yes],
[AC_CHECK_HEADERS([pthread.h],,
[AC_MSG_ERROR([the header is required])])])
AM_PATH_PYTHON([3.8],, [:]) AM_PATH_PYTHON([3.8],, [:])
AS_IF([test "$enable_checks_python" = yes -a "$enable_checks" = yes -a "$PYTHON" = ':'],
[AC_MSG_ERROR([Python is required])])
AC_PATH_PROGS([CPPCHECK], [cppcheck], [:]) AC_PATH_PROGS([CPPCHECK], [cppcheck], [:])
AS_IF([test "$enable_checks_cppcheck" = yes -a "$CPPCHECK" = ':'],
[AC_MSG_ERROR([cppcheck is required])])
AC_CACHE_CHECK([for Python YAML], AC_CACHE_CHECK([for Python YAML],
[libkernaux_cv_shell_pythonyaml_exists], [libkernaux_cv_shell_pythonyaml_exists],
@ -341,6 +361,8 @@ AC_CACHE_CHECK([for Python YAML],
PYTHON_YAML=yes PYTHON_YAML=yes
fi fi
fi]) fi])
AS_IF([test "$enable_checks_python" = yes -a "$enable_checks" = yes -a "$PYTHON_YAML" != 'yes'],
[AC_MSG_ERROR([Python YAML is required])])
AC_CACHE_CHECK([for Python Jinja 2], AC_CACHE_CHECK([for Python Jinja 2],
[libkernaux_cv_shell_pythonjinja2_exists], [libkernaux_cv_shell_pythonjinja2_exists],
@ -352,17 +374,8 @@ AC_CACHE_CHECK([for Python Jinja 2],
PYTHON_JINJA2=yes PYTHON_JINJA2=yes
fi fi
fi]) fi])
AS_IF([test "$enable_checks_python" = yes -a "$enable_checks" = yes -a "$PYTHON_JINJA2" != 'yes'],
[AC_MSG_ERROR([Python Jinja 2 is required])])
#############
# Test args #
#############
AS_IF([test "$enable_checks_cppcheck" = yes -a "$CPPCHECK" = ':'], AC_MSG_ERROR([cppcheck is required]))
AS_IF([test "$enable_checks_python" = yes -a "$PYTHON" = ':'], AC_MSG_ERROR([Python is required]))
AS_IF([test "$enable_checks_python" = yes -a "$PYTHON_YAML" != 'yes'], AC_MSG_ERROR([Python YAML is required]))
AS_IF([test "$enable_checks_python" = yes -a "$PYTHON_JINJA2" != 'yes'], AC_MSG_ERROR([Python Jinja 2 is required]))

2
examples/.gitignore vendored
View file

@ -1,2 +0,0 @@
/Makefile
/Makefile.in

4
libc/.gitignore vendored
View file

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

View file

@ -8,9 +8,30 @@ MY_CHECKS += check-cppcheck
check-cppcheck: check-cppcheck:
$(CPPCHECK) $(CPPCHECK_ARGS) $(CPPCHECK_INC) $(CPPCHECK_SUPPRESS) $(CPPCHECK_PATHS) $(CPPCHECK) $(CPPCHECK_ARGS) $(CPPCHECK_INC) $(CPPCHECK_SUPPRESS) $(CPPCHECK_PATHS)
CPPCHECK_ARGS = --quiet --error-exitcode=1 --std=c99 --inline-suppr --enable=warning,style,performance,portability CPPCHECK_ARGS = \
CPPCHECK_INC = -I$(top_builddir)/include -I$(top_srcdir)/include --quiet \
CPPCHECK_SUPPRESS = --suppress='unusedStructMember:examples/multiboot2_header_macro.c' --error-exitcode=1 \
CPPCHECK_SUPPRESS += --suppress='unusedStructMember:tests/test_multiboot2_info_*.c' --std=c99 \
CPPCHECK_PATHS = examples/ include/ libc/ src/ tests/ --inline-suppr \
--enable=warning,style,performance,portability
CPPCHECK_INC = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include
CPPCHECK_SUPPRESS = \
--suppress='unusedStructMember:examples/multiboot2_header_macro.c' \
--suppress='unusedStructMember:tests/test_multiboot2_info_*.c'
CPPCHECK_PATHS = \
$(top_builddir)/examples \
$(top_srcdir)/examples \
$(top_builddir)/include \
$(top_srcdir)/include \
$(top_builddir)/libc \
$(top_srcdir)/libc \
$(top_builddir)/src \
$(top_srcdir)/src \
$(top_builddir)/tests \
$(top_srcdir)/tests
endif endif

2
tests/.gitignore vendored
View file

@ -1,2 +0,0 @@
/Makefile
/Makefile.in