From 3666edd36b71ed0df05f6f49659f33d0c1286757 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 27 Apr 2009 23:37:25 +0200 Subject: [PATCH] New module 'libunistring'. --- ChangeLog | 7 +++++++ MODULES.html.sh | 1 + m4/libunistring.m4 | 37 +++++++++++++++++++++++++++++++++++++ modules/libunistring | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 m4/libunistring.m4 create mode 100644 modules/libunistring diff --git a/ChangeLog b/ChangeLog index 1c0d6a393..6389ebea2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-27 Bruno Haible + + New module 'libunistring'. + * modules/libunistring: New file. + * m4/libunistring.m4: New file. + * MODULES.html.sh (Unicode string functions): Add it. + 2009-04-27 Eric Blake maint.mk: allow package-specific header to provide diff --git a/MODULES.html.sh b/MODULES.html.sh index ea7e82080..06afa2d43 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -2646,6 +2646,7 @@ func_all_modules () func_echo "$element" func_begin_table + func_module libunistring func_module unitypes func_module ucs4-utf8 func_module ucs4-utf16 diff --git a/m4/libunistring.m4 b/m4/libunistring.m4 new file mode 100644 index 000000000..52ff06b61 --- /dev/null +++ b/m4/libunistring.m4 @@ -0,0 +1,37 @@ +# 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 ], [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 ], [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 +]) diff --git a/modules/libunistring b/modules/libunistring new file mode 100644 index 000000000..844b5c178 --- /dev/null +++ b/modules/libunistring @@ -0,0 +1,40 @@ +Description: +Unicode string functions. + +Files: +m4/libunistring.m4 + +Depends-on: +havelib +iconv + +configure.ac: +gl_LIBUNISTRING + +Makefile.am: + +Include: +#if HAVE_LIBUNISTRING +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + +Link: +$(LTLIBUNISTRING) when linking with libtool, $(LIBUNISTRING) otherwise + +License: +LGPL + +Maintainer: +Bruno Haible -- 2.11.0