Update `THANKS'.
[bpt/guile.git] / m4 / libunistring.m4
CommitLineData
24d56127 1# libunistring.m4 serial 1
61cd9dc9 2dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
24d56127
LC
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl gl_LIBUNISTRING
8dnl Searches for an installed libunistring.
9dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING
10dnl and LTLIBUNISTRING variables and augments the CPPFLAGS variable, and
11dnl #defines HAVE_LIBUNISTRING to 1. Otherwise, it sets and AC_SUBSTs
12dnl HAVE_LIBUNISTRING=no and LIBUNINSTRING and LTLIBUNISTRING to empty.
13
14AC_DEFUN([gl_LIBUNISTRING],
15[
16 dnl First, try to link without -liconv. libunistring often depends on
17 dnl libiconv, but we don't know (and often don't need to know) where
18 dnl libiconv is installed.
19 AC_LIB_HAVE_LINKFLAGS([unistring], [],
20 [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
21 [no, consider installing GNU libunistring])
22 if test "$ac_cv_libunistring" != yes; then
23 dnl Second try, with -liconv.
24 AC_REQUIRE([AM_ICONV])
25 if test -n "$LIBICONV"; then
26 glus_save_LIBS="$LIBS"
27 LIBS="$LIBS $LIBICONV"
28 AC_LIB_HAVE_LINKFLAGS([unistring], [],
29 [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
30 [no, consider installing GNU libunistring])
31 if test -n "$LIBUNISTRING"; then
32 LIBUNISTRING="$LIBUNISTRING $LIBICONV"
33 fi
34 LIBS="$glus_save_LIBS"
35 fi
36 fi
37])