Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checking how to aquire the *gettext family of symbols portably is annoyingly complex, and may come from the libc, or standalone. builtin dependency: This detects if libintl is unneeded, because the *gettext family of symbols is available in the libc. system dependency: This detects if libintl is installed as separate software, linkable via -lintl; unfortunately, GNU gettext does not ship pkg-config files for it. Fixes #3929
- Loading branch information
1 parent
ad20603
commit 2c6ccfe
Showing
4 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## New custom dependency for libintl | ||
|
||
Meson can now find the library needed for translating messages via gettext. | ||
This works both on systems where libc provides gettext, such as GNU or musl, | ||
and on systems where the gettext project's standalone intl support library is | ||
required, such as macOS. | ||
|
||
Rather than doing something such as: | ||
|
||
``` | ||
intl_dep = dependency('', required: false) | ||
if cc.has_function('ngettext') | ||
intl_found = true | ||
else | ||
intl_dep = cc.find_library('intl', required: false) | ||
intl_found = intl_dep.found() | ||
endif | ||
if intl_found | ||
# build options that need gettext | ||
conf.set('ENABLE_NLS', 1) | ||
endif | ||
``` | ||
|
||
one may simply use: | ||
|
||
``` | ||
intl_dep = dependency('intl') | ||
if intl_dep.found() | ||
# build options that need gettext | ||
conf.set('ENABLE_NLS', 1) | ||
endif | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters