Home Explore Blog CI



nixpkgs

doc/hooks/libiconv.section.md
e37d9a2c45471023eb7ed9ebf73cb0ab66b60dce5b74fe8600000003000001c8
# libiconv, libintl {#libiconv-libintl}

A few libraries automatically add to `NIX_LDFLAGS` their library, making their symbols automatically available to the linker. This includes libiconv and libintl (gettext). This is done to provide compatibility between GNU Linux, where libiconv and libintl are bundled in, and other systems where that might not be the case. Sometimes, this behavior is not desired. To disable this behavior, set `dontAddExtraLibs`.

Chunks
594c8223 (1st chunk of `doc/hooks/libiconv.section.md`)
Title: Managing Automatic Linking of libiconv and libintl
Summary
Libraries like `libiconv` (for character set conversion) and `libintl` (gettext, for internationalization) can automatically add themselves to `NIX_LDFLAGS`, making their symbols available to the linker. This ensures compatibility, especially between GNU Linux (where they're often bundled) and other systems. However, sometimes this automatic behavior is unwanted. To disable it, set the `dontAddExtraLibs` attribute. This prevents these libraries from being automatically included during linking, allowing for more control over the build process and avoiding potential conflicts or unexpected behavior arising from their automatic inclusion, offering greater flexibility in managing dependencies.