aboutsummaryrefslogtreecommitdiffstats
path: root/config/user-gettext.m4
diff options
context:
space:
mode:
authorRafael Kitover <[email protected]>2019-04-19 19:09:29 +0000
committerBrian Behlendorf <[email protected]>2019-04-19 12:09:29 -0700
commite8864b1b28c231d80f0df8b1c4b893f9ada73aad (patch)
treecec47485a186c97254b54486f87c2359aef5736b /config/user-gettext.m4
parent34d343c2a8ff849c46001c2ee2f1081f489192ef (diff)
config: libintl/libiconv for gettext() detection
Detect in autoconf whether `-lintl` and possibly `-liconv` are necessary for translation functions like `gettext()`. The actual autoconf code is just: ``` AM_ICONV AM_GNU_GETTEXT([external]) LIBS="$LIBS $LTLIBINTL $LTLIBICONV" ``` References: https://www.gnu.org/software/gettext/manual/html_node/AM_005fGNU_005fGETTEXT.html https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html The reason to check for `libiconv` and add it separately is that this is sometimes necessary if users are linking statically. The `config/*.m4` files were added by running `gettextize` and removing everything else. The empty file `config/config.rpath` is necessary to avoid an error with some versions of autotools, see: http://ramblingfoo.blogspot.com/2007/07/required-file-configrpath-not-found.html The `config.rpath` copied by `gettextize` does not currently work, there is some kind of missing interaction with `libtool` and it tries to apply `libtool` flags to the compiler. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Rafael Kitover <[email protected]> Closes #8554
Diffstat (limited to 'config/user-gettext.m4')
-rw-r--r--config/user-gettext.m48
1 files changed, 8 insertions, 0 deletions
diff --git a/config/user-gettext.m4 b/config/user-gettext.m4
new file mode 100644
index 000000000..89d1d45bf
--- /dev/null
+++ b/config/user-gettext.m4
@@ -0,0 +1,8 @@
+dnl #
+dnl # Check if libintl and possibly libiconv are needed for gettext() functionality
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_USER_GETTEXT], [
+ AM_ICONV
+ AM_GNU_GETTEXT([external])
+ LIBS="$LIBS $LTLIBINTL $LTLIBICONV"
+])