summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-07 16:03:47 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-07 16:03:47 -0800
commit167ad7fa3a339da96798da49d05c3125045a87c2 (patch)
treecef81cd9a3fc39878ec8a4c874ffe71905877d0a /configure.ac
parent4b54c211e5e86d6ed62386ad9b7d676808b55766 (diff)
Use gettext() to localize messages if available
Originally fixed for Solaris in May 2000 by Steve Swales under Sun bug 4256527 "xhost messages not internationalized" Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b9c8a9c..d69ebab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,27 @@ esac
# Checks for library functions.
AC_CHECK_FUNCS([inet_aton])
+# Internationalization & localization support
+AC_SEARCH_LIBS([gettext], [intl], [USE_GETTEXT="yes"], [USE_GETTEXT="no"])
+AC_MSG_CHECKING([where to install localized messages])
+AC_ARG_WITH([localedir], AS_HELP_STRING([--with-localedir=<path>],
+ [Path to install message files in (default: datadir/locale)]),
+ [LOCALEDIR=${withval}], [LOCALEDIR=${datadir}/locale])
+if test "x$LOCALEDIR" = "xno" -o "x$USE_GETTEXT" = "xno" ; then
+ AC_MSG_RESULT([nowhere])
+ USE_GETTEXT="no"
+else
+ AC_SUBST([LOCALEDIR])
+ AC_MSG_RESULT([$LOCALEDIR])
+fi
+
+if test "x$USE_GETTEXT" = "xyes" ; then
+ AC_DEFINE([USE_GETTEXT], 1,
+ [Define to 1 if you want to use the gettext() function.])
+fi
+AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes")
+
+
AC_CONFIG_FILES([
Makefile
man/Makefile])