[ruby/yarp] Document building, more macro changes
https://github.com/ruby/yarp/commit/4214f262d2
This commit is contained in:
parent
5d78ec8a94
commit
04f4e0aeb2
26
docs/building.md
Normal file
26
docs/building.md
Normal file
@ -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)
|
@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|||||||
"config.h.in",
|
"config.h.in",
|
||||||
"config.yml",
|
"config.yml",
|
||||||
"configure",
|
"configure",
|
||||||
|
"docs/building.md",
|
||||||
"docs/configuration.md",
|
"docs/configuration.md",
|
||||||
"docs/design.md",
|
"docs/design.md",
|
||||||
"docs/encoding.md",
|
"docs/encoding.md",
|
||||||
|
@ -12,18 +12,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// YP_EXPORTED_FUNCTION
|
// YP_EXPORTED_FUNCTION
|
||||||
#if defined(_WIN32)
|
#ifndef YP_EXPORTED_FUNCTION
|
||||||
# define YP_EXPORTED_FUNCTION __declspec(dllexport) extern
|
# ifdef YP_EXPORT_SYMBOLS
|
||||||
#elif defined(YP_EXPORT_SYMBOLS)
|
# ifdef _WIN32
|
||||||
# ifndef YP_EXPORTED_FUNCTION
|
# define YP_EXPORTED_FUNCTION __declspec(dllexport) extern
|
||||||
# ifndef RUBY_FUNC_EXPORTED
|
|
||||||
# define YP_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern
|
|
||||||
# else
|
# else
|
||||||
# define YP_EXPORTED_FUNCTION RUBY_FUNC_EXPORTED
|
# define YP_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern
|
||||||
# endif
|
# endif
|
||||||
|
# else
|
||||||
|
# define YP_EXPORTED_FUNCTION
|
||||||
# endif
|
# endif
|
||||||
#else
|
|
||||||
# define YP_EXPORTED_FUNCTION
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// YP_ATTRIBUTE_UNUSED
|
// YP_ATTRIBUTE_UNUSED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user