|
slibc
0.1.3
Educational C Standard Library Project
|
Shatter Libc (slibc) is C89 compliant Standard Library written for educational purposes.
To build, simply run cmake in a build directory, then run make
To install slibc, you can run the install target.
This will install the library and header files onto your system (/usr/local/lib/slibc and /usr/local/include/slibc by default). It will also install a slibc.conf into /etc/ld.so.conf.d and run ldconfig.
To uninstall slibc, you can either run
or manually uninstall the files described in install_manifest.txt, which is what make uninstall does by default.
make install and make uninstall may require elevated permissions to run correctly.
You may also need to set $PKG_CONFIG_PATH to the install directory of libslibc.pc and libslibc_start_main.pc (by default /usr/local/share/pkgconfig).
There is an example program that can also be compiled and ran.
This creates a program that is linked against slibc, which can be verified with
If you wish to use slibc to build your own projects, be sure to not link against stdlib and to not use stdinc.
Also ensure you include the header files for slibc and to dynamically link with libslibc.so and statically link with libslibc_start_main.a.
An example command would be
Alternatively, the provided CMakeLists.txt in the example directory provides a good starting point to build your own projects.
The execute_process is there to grab the LDFLAGS from pkg-config. Alternatively, you can instead have the following line
to not link with stdlib. The execute_process is there in the event additional linker flags are added.
In the tests directory there is a series of tests for each off the standard library functions. Testing these yourself is done similary to building and executing the example program.
Testing is incomplete/
slibc also allows for the creation of documenation using doxygen and doxygen-awesome-css. To do so, simply run doxygen in the build directory of slibc after running cmake.
Documentation is also hosted at slibc.amberlagrange.com.
Documentation is not complete.
Currently slibc only supports Linux x86_64, but plans to supports x86, and potentially Aarch64 in the future.
Other OSes will most likely not be supported.