From 04f4e0aeb2e9543e360a566eca0d1cea859b13dd Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 31 Jul 2023 15:26:34 -0400 Subject: [ruby/yarp] Document building, more macro changes https://github.com/ruby/yarp/commit/4214f262d2 --- docs/building.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/building.md (limited to 'docs') diff --git a/docs/building.md b/docs/building.md new file mode 100644 index 0000000000..758f02eb41 --- /dev/null +++ b/docs/building.md @@ -0,0 +1,26 @@ +# Building + +The following describes how to build YARP from source. + +## Common + +All of the source files match `src/**/*.c` and all of the headers match `include/**/*.h`. + +The following flags should be used to compile YARP: + +* `-std=c99` - Use the C99 standard +* `-Wall -Wconversion -Wextra -Wpedantic -Wundef` - Enable the warnings we care about +* `-Werror` - Treat warnings as errors +* `-fvisibility=hidden` - Hide all symbols by default + +The following flags can be used to compile YARP: + +* `-DHAVE_MMAP` - Should be passed if the system has the `mmap` function +* `-DHAVE_SNPRINTF` - Should be passed if the system has the `snprintf` function + +## Shared + +If you want to build YARP as a shared library and link against it, you should compile with: + +* `-fPIC -shared` - Compile as a shared library +* `-DYP_EXPORT_SYMBOLS` - Export the symbols (by default nothing is exported) -- cgit v1.2.3