summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/m4/xdvi-check-langinfo.m4
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/xdvik/m4/xdvi-check-langinfo.m4')
-rw-r--r--Build/source/texk/xdvik/m4/xdvi-check-langinfo.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/Build/source/texk/xdvik/m4/xdvi-check-langinfo.m4 b/Build/source/texk/xdvik/m4/xdvi-check-langinfo.m4
new file mode 100644
index 00000000000..34de37e1d42
--- /dev/null
+++ b/Build/source/texk/xdvik/m4/xdvi-check-langinfo.m4
@@ -0,0 +1,29 @@
+# Autoconf macros for xdvik.
+# Copyright (C) ???? - 2009 Paul Vojta <xdvi-core@lists.sourceforge.net>
+# and/or
+# Copyright (C) ???? - 2009 Stefan Ulrich <xdvi-core@lists.sourceforge.net>
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# XDVI_CHECK_LANGINFO
+# -------------------
+# Check for nl_langinfo(), <langinfo.h>, and if nl_langinfo(CODESET)
+# is working.
+AC_DEFUN([XDVI_CHECK_LANGINFO],
+[AC_CHECK_FUNCS([nl_langinfo])
+AC_CHECK_HEADERS([langinfo.h])
+if test "x$ac_cv_func_nl_langinfo:$ac_cv_header_langinfo_h" = xyes:yes; then
+ AC_CACHE_CHECK([if nl_langinfo(CODESET) is working],
+ [xdvi_cv_nl_langinfo_codeset],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+ [[char* cs = nl_langinfo(CODESET);]])],
+ [xdvi_cv_nl_langinfo_codeset=yes],
+ [xdvi_cv_nl_langinfo_codeset=no])])
+ AS_IF([test "x$xdvi_cv_nl_langinfo_codeset" = xyes],
+ [AC_DEFINE([HAVE_WORKING_NL_LANGINFO_CODESET], 1,
+ [Define if the CODESET argument to nl_langinfo works.])])
+fi
+]) # XDVI_CHECK_LANGINFO