view m4/libunistring.m4 @ 12559:c2cbabec01dd

update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
author Jim Meyering <meyering@redhat.com>
date Fri, 01 Jan 2010 10:31:12 +0100
parents 53ce4539660e
children e1c32cc240d9
line wrap: on
line source

# libunistring.m4 serial 1
dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl gl_LIBUNISTRING
dnl Searches for an installed libunistring.
dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING
dnl and LTLIBUNISTRING variables and augments the CPPFLAGS variable, and
dnl #defines HAVE_LIBUNISTRING to 1. Otherwise, it sets and AC_SUBSTs
dnl HAVE_LIBUNISTRING=no and LIBUNINSTRING and LTLIBUNISTRING to empty.

AC_DEFUN([gl_LIBUNISTRING],
[
  dnl First, try to link without -liconv. libunistring often depends on
  dnl libiconv, but we don't know (and often don't need to know) where
  dnl libiconv is installed.
  AC_LIB_HAVE_LINKFLAGS([unistring], [],
    [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
    [no, consider installing GNU libunistring])
  if test "$ac_cv_libunistring" != yes; then
    dnl Second try, with -liconv.
    AC_REQUIRE([AM_ICONV])
    if test -n "$LIBICONV"; then
      glus_save_LIBS="$LIBS"
      LIBS="$LIBS $LIBICONV"
      AC_LIB_HAVE_LINKFLAGS([unistring], [],
        [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
        [no, consider installing GNU libunistring])
      if test -n "$LIBUNISTRING"; then
        LIBUNISTRING="$LIBUNISTRING $LIBICONV"
      fi
      LIBS="$glus_save_LIBS"
    fi
  fi
])