Now that libunistring is released, I'm adding to gnulib a module that prepares for using it as a (possibly shared) library.
2009-04-27 Bruno Haible <br...@clisp.org> New module 'libunistring'. * modules/libunistring: New file. * m4/libunistring.m4: New file. * MODULES.html.sh (Unicode string functions): Add it. ============================ modules/libunistring ============================ Description: Unicode string functions. Files: m4/libunistring.m4 Depends-on: havelib iconv configure.ac: gl_LIBUNISTRING Makefile.am: Include: #if HAVE_LIBUNISTRING # include <unitypes.h> # include <unistr.h> # include <uniconv.h> # include <unistdio.h> # include <uniname.h> # include <unictype.h> # include <uniwidth.h> # include <uniwbrk.h> # include <unilbrk.h> # include <uninorm.h> # include <unicase.h> # include <uniregex.h> # include <unistring/version.h> #endif Link: $(LTLIBUNISTRING) when linking with libtool, $(LIBUNISTRING) otherwise License: LGPL Maintainer: Bruno Haible ============================= m4/libunistring.m4 ============================= # libunistring.m4 serial 1 dnl Copyright (C) 2009 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 ])