| 1 |
# Autoconf macros for xdvik. |
| 2 |
# Copyright (C) 2004 - 2009 Stefan Ulrich <[email protected]> |
| 3 |
# Copyright (C) 2009 Peter Breitenlohner <[email protected]> |
| 4 |
# |
| 5 |
# This file is free software; the copyright holders |
| 6 |
# give unlimited permission to copy and/or distribute it, |
| 7 |
# with or without modifications, as long as this notice is preserved. |
| 8 |
|
| 9 |
# XDVI_CHECK_LANGINFO |
| 10 |
# ------------------- |
| 11 |
# Check for nl_langinfo(), <langinfo.h>, and if nl_langinfo(CODESET) |
| 12 |
# is working. |
| 13 |
AC_DEFUN([XDVI_CHECK_LANGINFO], |
| 14 |
[AC_CHECK_FUNCS([nl_langinfo]) |
| 15 |
AC_CHECK_HEADERS([langinfo.h]) |
| 16 |
if test "x$ac_cv_func_nl_langinfo:$ac_cv_header_langinfo_h" = xyes:yes; then |
| 17 |
AC_CACHE_CHECK([if nl_langinfo(CODESET) is working], |
| 18 |
[xdvi_cv_nl_langinfo_codeset], |
| 19 |
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], |
| 20 |
[[char* cs = nl_langinfo(CODESET);]])], |
| 21 |
[xdvi_cv_nl_langinfo_codeset=yes], |
| 22 |
[xdvi_cv_nl_langinfo_codeset=no])]) |
| 23 |
AS_IF([test "x$xdvi_cv_nl_langinfo_codeset" = xyes], |
| 24 |
[AC_DEFINE([HAVE_WORKING_NL_LANGINFO_CODESET], 1, |
| 25 |
[Define if the CODESET argument to nl_langinfo works.])]) |
| 26 |
fi |
| 27 |
]) # XDVI_CHECK_LANGINFO |