Skip to content

Commit 5ac4de4

Browse files
Remove libc (#158)
It has been moved to https://github.com/tailix/libclayer
1 parent 3cef48e commit 5ac4de4

28 files changed

+12
-653
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
- name: autogen
123123
run: ./autogen.sh
124124
- name: configure
125-
run: ./configure --host='i386-elf' ${{matrix.assert}} --enable-freestanding --with-libc CC="$(which i686-linux-gnu-gcc)"
125+
run: ./configure --host='i386-elf' ${{matrix.assert}} --enable-freestanding CC="$(which i686-linux-gnu-gcc)"
126126
- name: make
127127
run: make
128128

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
/examples/Makefile.in
4646
/fixtures/Makefile.in
4747
/include/Makefile.in
48-
/libc/Makefile.in
49-
/libc/include/Makefile.in
5048
/tests/Makefile.in
5149

5250
###########################################
@@ -78,8 +76,6 @@
7876
/examples/Makefile
7977
/fixtures/Makefile
8078
/include/Makefile
81-
/libc/Makefile
82-
/libc/include/Makefile
8379
/tests/Makefile
8480

8581
/libkernaux.pc

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Common
44
* Add your name to [COPYING](/COPYING).
55
* Don't add your name to `AUTHORS` - it's for maintainers.
66
* Add copyright notice in the beginning of changed files except the headers.
7-
* If you change the behavior (even just fix a bug) of **libkernaux** (stable) or
8-
[libc](/libc), add a record to [ChangeLog](/ChangeLog).
7+
* If you change the behavior (even just fix a bug), add a record
8+
to [ChangeLog](/ChangeLog).
99

1010
Prohibitions:
1111

ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2022-12-27 Alex Kotov <kotovalexarian@gmail.com>
2+
3+
* configure.ac: Package "--with[out]-libc" has been removed
4+
15
2022-12-23 Alex Kotov <kotovalexarian@gmail.com>
26

37
libkernaux 0.7.0 released

Makefile.am

-16
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ EXTRA_DIST = autogen.sh CONTRIBUTING.md sha256sums.txt src/assert.h
66

77
SUBDIRS = include
88

9-
if WITH_LIBC
10-
# FIXME: after "make clean" libc is not rebuiling
11-
SUBDIRS += libc
12-
endif
13-
149
SUBDIRS += .
1510

1611
if ENABLE_FIXTURES
@@ -21,9 +16,6 @@ if ENABLE_CHECKS
2116
SUBDIRS += examples tests
2217
endif
2318

24-
libc/libc.la:
25-
$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libc libc.la
26-
2719
AM_CFLAGS += -DKERNAUX_ACCESS_PRIVATE
2820

2921
lib_LTLIBRARIES = libkernaux.la
@@ -45,14 +37,6 @@ libkernaux_la_SOURCES = \
4537
src/generic/mutex.c \
4638
src/runtime.c
4739

48-
########
49-
# libc #
50-
########
51-
52-
if WITH_LIBC
53-
libkernaux_la_LIBADD += libc/libc.la
54-
endif
55-
5640
#######
5741
# ARCH #
5842
#######

README.md

+5-15
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ zero). Work-in-progress APIs can change at any time.
8181
* [Example: vfprintf](/examples/printf_file_va.c)
8282
* [Example: snprintf](/examples/printf_str.c)
8383
* [Example: vsnprintf](/examples/printf_str_va.c)
84-
* libc replacement (*work in progress*)
85-
* [ctype.h](/libc/include/ctype.h)
86-
* [errno.h](/libc/include/errno.h)
87-
* [inttypes.h](/libc/include/inttypes.h)
88-
* [setjmp.h](/libc/include/setjmp.h)
89-
* [stdlib.h](/libc/include/stdlib.h)
90-
* [string.h](/libc/include/string.h)
91-
* [sys/types.h](/libc/include/sys/types.h)
9284
* Architecture-specific code (*work in progress*)
9385
* [Declarations](/include/kernaux/arch/)
9486
* [Functions](/include/kernaux/asm/)
@@ -143,11 +135,6 @@ stable options.
143135
* `--enable-pkg-config[=PATH]` - install pkg-config files
144136
[PATH='${libdir}/pkgconfig']
145137

146-
#### Packages
147-
148-
* `--with-libc` - provides the replacement for some standard C functions.
149-
Useful in freestanding environment, where no libc is present.
150-
151138
### Default options
152139

153140
#### Features
@@ -211,6 +198,9 @@ You can test with `make check`.
211198

212199
Create configuration script with `./autogen.sh` (if present).
213200

201+
The library requires some functions from the standard C library.
202+
Use [libclayer](https://github.com/tailix/libclayer).
203+
214204
Let's assume that your target triplet is `i386-elf`. Configure with
215205
[cross-compiler](https://wiki.osdev.org/GCC_Cross-Compiler) in `$PATH` to make
216206
without it in `$PATH`:
@@ -220,8 +210,8 @@ without it in `$PATH`:
220210
--host='i386-elf' \
221211
--disable-shared \
222212
--enable-freestanding \
223-
--with-libc \
224-
CC="$(which i386-elf-gcc)"
213+
CC="$(which i386-elf-gcc)" \
214+
CFLAGS='-I<path/to/libc/headers>'
225215
```
226216

227217
The variables include `AR`, `AS`, `CC`, `CCAS`, `LD`, `NM`, `OBJDUMP`, `RANLIB`,

configure.ac

-20
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ AC_CONFIG_FILES([
3030
fixtures/Makefile
3131
fixtures/multiboot2_bin_examples_gen.c
3232
include/Makefile
33-
libc/Makefile
34-
libc/include/Makefile
3533
include/kernaux/version.h
3634
tests/Makefile
3735
tests/test_multiboot2_header_print.c
@@ -62,7 +60,6 @@ AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [ena
6260
AC_ARG_ENABLE([checks-cppcheck], AS_HELP_STRING([--enable-checks-cppcheck], [enable cppcheck]))
6361
AC_ARG_ENABLE([checks-pthreads], AS_HELP_STRING([--enable-checks-pthreads], [enable tests that require pthreads]))
6462
AC_ARG_ENABLE([checks-python], AS_HELP_STRING([--enable-checks-python], [enable tests that require Python 3 with YAML and Jinja2]))
65-
AC_ARG_ENABLE([split-libc], AS_HELP_STRING([--enable-split-libc], [split off libc]))
6663

6764
dnl Features (with parameter)
6865
AC_ARG_ENABLE([pkg-config], AS_HELP_STRING([--enable-pkg-config@<:@=PATH@:>@], [install pkg-config files @<:@PATH='${libdir}/pkgconfig'@:>@]))
@@ -86,9 +83,6 @@ AC_ARG_WITH( [printf], AS_HELP_STRING([--without-printf], [wit
8683
AC_ARG_WITH( [printf-fmt], AS_HELP_STRING([--without-printf-fmt], [without printf format parser]))
8784
AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils]))
8885

89-
dnl Packages (disabled by default)
90-
AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement]))
91-
9286

9387

9488
################
@@ -151,7 +145,6 @@ AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [ena
151145
AS_IF([test "$enable_checks_cppcheck" = yes], [enable_checks_cppcheck=yes], [enable_checks_cppcheck=no])
152146
AS_IF([test "$enable_checks_pthreads" = yes], [enable_checks_pthreads=yes], [enable_checks_pthreads=no])
153147
AS_IF([test "$enable_checks_python" = yes], [enable_checks_python=yes], [enable_checks_python=no])
154-
AS_IF([test "$enable_split_libc" = yes], [enable_split_libc=yes], [enable_split_libc=no])
155148

156149
dnl Features (with parameter)
157150
AS_IF([test "$enable_pkg_config" = yes], [enable_pkg_config='${libdir}/pkgconfig'])
@@ -176,9 +169,6 @@ AS_IF([test "$with_printf" = no ], [with_printf=no], [wit
176169
AS_IF([test "$with_printf_fmt" = no ], [with_printf_fmt=no], [with_printf_fmt=yes])
177170
AS_IF([test "$with_units" = no ], [with_units=no], [with_units=yes])
178171

179-
dnl Packages (disabled by default)
180-
AS_IF([test "$with_libc" = yes], [with_libc=yes], [with_libc=no])
181-
182172

183173

184174
#############
@@ -187,8 +177,6 @@ AS_IF([test "$with_libc" = yes], [with_libc=yes], [wit
187177

188178
AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests]))
189179
AS_IF([test "$enable_fixtures" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding fixtures]))
190-
AS_IF([test "$enable_checks" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests]))
191-
AS_IF([test "$enable_fixtures" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with fixtures]))
192180

193181
AS_IF([test "$with_printf" = yes -a "$with_ntoa" = no], AC_MSG_ERROR([package `printf' requires package `ntoa']))
194182
AS_IF([test "$with_printf" = yes -a "$with_printf_fmt" = no], AC_MSG_ERROR([package `printf' requires package `printf-fmt']))
@@ -220,7 +208,6 @@ AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])
220208
AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes])
221209
AM_CONDITIONAL([ENABLE_CHECKS_PTHREADS], [test "$enable_checks_pthreads" = yes])
222210
AM_CONDITIONAL([ENABLE_CHECKS_PYTHON], [test "$enable_checks_python" = yes])
223-
AM_CONDITIONAL([ENABLE_SPLIT_LIBC], [test "$enable_split_libc" = yes])
224211

225212
dnl Features (with parameter)
226213
AM_CONDITIONAL([ENABLE_PKG_CONFIG], [test ! -z "$enable_pkg_config"])
@@ -242,9 +229,6 @@ AM_CONDITIONAL([WITH_PRINTF], [test "$with_printf" = yes])
242229
AM_CONDITIONAL([WITH_PRINTF_FMT], [test "$with_printf_fmt" = yes])
243230
AM_CONDITIONAL([WITH_UNITS], [test "$with_units" = yes])
244231

245-
dnl Packages (disabled by default)
246-
AM_CONDITIONAL([WITH_LIBC], [test "$with_libc" = yes])
247-
248232
dnl Packages (virtual)
249233
AM_CONDITIONAL([WITH_ARCH_X86], [test "$with_arch_i386" = yes -o "$with_arch_x86_64" = yes])
250234

@@ -275,7 +259,6 @@ AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS],
275259
AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])])
276260
AS_IF([test "$enable_checks_pthreads" = yes], [AC_DEFINE([ENABLE_CHECKS_PTHREADS], [1], [enabled tests that require pthreads])])
277261
AS_IF([test "$enable_checks_python" = yes], [AC_DEFINE([ENABLE_CHECKS_PYTHON], [1], [enabled tests that require Python 3 with YAML and Jinja2])])
278-
AS_IF([test "$enable_split_libc" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBC], [1], [split off libc])])
279262

280263
dnl Packages (enabled by default)
281264
AS_IF([test "$with_arch_i386" = yes], [AC_DEFINE([WITH_ARCH_I386], [1], [with architecture i386])])
@@ -294,9 +277,6 @@ AS_IF([test "$with_printf" = yes], [AC_DEFINE([WITH_PRINTF],
294277
AS_IF([test "$with_printf_fmt" = yes], [AC_DEFINE([WITH_PRINTF_FMT], [1], [with printf format parser])])
295278
AS_IF([test "$with_units", = yes], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])])
296279

297-
dnl Packages (disabled by default)
298-
AS_IF([test "$with_libc" = yes], [AC_DEFINE([WITH_LIBC], [1], [with libc replacement])])
299-
300280
dnl Packages (virtual)
301281
AS_IF([test "$with_arch_i386" = yes], [AC_DEFINE([WITH_ARCH_X86], [1], [with architecture x86])])
302282
AS_IF([test "$with_arch_x86_64" = yes], [AC_DEFINE([WITH_ARCH_X86], [1], [with architecture x86])])

libc/Makefile.am

-30
This file was deleted.

libc/include/Makefile.am

-9
This file was deleted.

libc/include/ctype.h

-20
This file was deleted.

libc/include/errno.h

-16
This file was deleted.

libc/include/inttypes.h

-12
This file was deleted.

libc/include/kernaux/libc.h

-26
This file was deleted.

libc/include/setjmp.h

-27
This file was deleted.

libc/include/stdlib.h

-29
This file was deleted.

0 commit comments

Comments
 (0)