Skip to content

Commit

Permalink
Add docs for lib bindings with supported library versions (#14900)
Browse files Browse the repository at this point in the history
Co-authored-by: Quinton Miller <[email protected]>
  • Loading branch information
straight-shoota and HertzDevil authored Nov 15, 2024
1 parent 32be3b6 commit 6cec6a9
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/big/lib_gmp.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Supported library versions:
#
# * libgmp
# * libmpir
#
# See https://crystal-lang.org/reference/man/required_libraries.html#big-numbers
{% if flag?(:win32) && !flag?(:gnu) %}
@[Link("mpir")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
Expand Down
5 changes: 5 additions & 0 deletions src/compiler/crystal/ffi/lib_ffi.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Supported library versions:
#
# * libffi
#
# See https://crystal-lang.org/reference/man/required_libraries.html#compiler-dependencies
module Crystal
@[Link("ffi")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
Expand Down
5 changes: 5 additions & 0 deletions src/crystal/lib_iconv.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ require "c/stddef"
{% raise "The `without_iconv` flag is preventing you to use the LibIconv module" %}
{% end %}

# Supported library versions:
#
# * libiconv-gnu
#
# See https://crystal-lang.org/reference/man/required_libraries.html#internationalization-conversion
@[Link("iconv")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "iconv-2.dll")]
Expand Down
5 changes: 5 additions & 0 deletions src/crystal/system/unix/lib_event2.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ require "c/netdb"
@[Link("rt")]
{% end %}

# Supported library versions:
#
# * libevent2
#
# See https://crystal-lang.org/reference/man/required_libraries.html#other-runtime-libraries
{% if flag?(:openbsd) %}
@[Link("event_core")]
@[Link("event_extra")]
Expand Down
5 changes: 5 additions & 0 deletions src/gc/boehm.cr
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ require "crystal/tracing"
@[Link("gc", pkg_config: "bdw-gc")]
{% end %}

# Supported library versions:
#
# * libgc (8.2.0+; earlier versions require a patch for MT support)
#
# See https://crystal-lang.org/reference/man/required_libraries.html#other-runtime-libraries
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "gc.dll")]
{% end %}
Expand Down
11 changes: 11 additions & 0 deletions src/lib_c.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Supported library versions:
#
# * glibc (2.26+)
# * musl libc (1.2+)
# * system libraries of several BSDs
# * macOS system library (11+)
# * MSVCRT
# * WASI
# * bionic libc
#
# See https://crystal-lang.org/reference/man/required_libraries.html#system-library
{% if flag?(:msvc) %}
@[Link({{ flag?(:static) ? "libucrt" : "ucrt" }})]
{% end %}
Expand Down
5 changes: 5 additions & 0 deletions src/lib_z/lib_z.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Supported library versions:
#
# * zlib
#
# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries
@[Link("z")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "zlib1.dll")]
Expand Down
5 changes: 5 additions & 0 deletions src/llvm/lib_llvm.cr
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
end
{% end %}

# Supported library versions:
#
# * LLVM (8-19; aarch64 requires 13+)
#
# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries
{% begin %}
lib LibLLVM
IS_180 = {{LibLLVM::VERSION.starts_with?("18.0")}}
Expand Down
6 changes: 6 additions & 0 deletions src/openssl/lib_crypto.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Supported library versions:
#
# * openssl (1.1.0–3.3+)
# * libressl (2.0–3.8+)
#
# See https://crystal-lang.org/reference/man/required_libraries.html#tls
{% begin %}
lib LibCrypto
{% if flag?(:msvc) %}
Expand Down
6 changes: 6 additions & 0 deletions src/openssl/lib_ssl.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ require "./lib_crypto"
{% raise "The `without_openssl` flag is preventing you to use the LibSSL module" %}
{% end %}

# Supported library versions:
#
# * openssl (1.1.0–3.3+)
# * libressl (2.0–4.0+)
#
# See https://crystal-lang.org/reference/man/required_libraries.html#tls
{% begin %}
lib LibSSL
{% if flag?(:msvc) %}
Expand Down
5 changes: 5 additions & 0 deletions src/regex/lib_pcre.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Supported library versions:
#
# * libpcre
#
# See https://crystal-lang.org/reference/man/required_libraries.html#regular-expression-engine
@[Link("pcre", pkg_config: "libpcre")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "pcre.dll")]
Expand Down
5 changes: 5 additions & 0 deletions src/regex/lib_pcre2.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Supported library versions:
#
# * libpcre2 (recommended: 10.36+)
#
# See https://crystal-lang.org/reference/man/required_libraries.html#regular-expression-engine
@[Link("pcre2-8", pkg_config: "libpcre2-8")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "pcre2-8.dll")]
Expand Down
5 changes: 5 additions & 0 deletions src/xml/libxml2.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ require "./parser_options"
require "./html_parser_options"
require "./save_options"

# Supported library versions:
#
# * libxml2
#
# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries
@[Link("xml2", pkg_config: "libxml-2.0")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "libxml2.dll")]
Expand Down
5 changes: 5 additions & 0 deletions src/yaml/lib_yaml.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
require "./enums"

# Supported library versions:
#
# * libyaml
#
# See https://crystal-lang.org/reference/man/required_libraries.html#other-stdlib-libraries
@[Link("yaml", pkg_config: "yaml-0.1")]
{% if compare_versions(Crystal::VERSION, "1.11.0-dev") >= 0 %}
@[Link(dll: "yaml.dll")]
Expand Down

0 comments on commit 6cec6a9

Please sign in to comment.