Use Gnulib's `localcharset', with local patches.
This follows Bruno Haible's suggestion at <http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00055.html>. * m4/gnulib-cache.m4: Add `gl_LOCAL_DIR'; use `localcharset'. * Makefile.am (EXTRA_DIST): Add gnulib-local/lib/localcharset.[ch].diff. (TESTS_ENVIRONMENT): New variable. * gnulib-local/lib/localcharset.c.diff, gnulib-local/lib/localcharset.h.diff: New files. * test-suite/Makefile.am (TESTS_ENVIRONMENT): Add @LOCALCHARSET_TESTS_ENVIRONMENT@. * test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Likewise.
This commit is contained in:
parent
a00c31bc46
commit
c2c2b5a49b
17 changed files with 1780 additions and 8 deletions
23
m4/codeset.m4
Normal file
23
m4/codeset.m4
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# codeset.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2006, 2008-2011 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 From Bruno Haible.
|
||||
|
||||
AC_DEFUN([AM_LANGINFO_CODESET],
|
||||
[
|
||||
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <langinfo.h>]],
|
||||
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
|
||||
[am_cv_langinfo_codeset=yes],
|
||||
[am_cv_langinfo_codeset=no])
|
||||
])
|
||||
if test $am_cv_langinfo_codeset = yes; then
|
||||
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
|
||||
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
|
||||
fi
|
||||
])
|
||||
50
m4/configmake.m4
Normal file
50
m4/configmake.m4
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# configmake.m4 serial 1
|
||||
dnl Copyright (C) 2010-2011 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.
|
||||
|
||||
# gl_CONFIGMAKE_PREP
|
||||
# ------------------
|
||||
# Guarantee all of the standard directory variables, even when used with
|
||||
# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
|
||||
# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
|
||||
AC_DEFUN([gl_CONFIGMAKE_PREP],
|
||||
[
|
||||
dnl Technically, datadir should default to datarootdir. But if
|
||||
dnl autoconf is too old to provide datarootdir, then reversing the
|
||||
dnl definition is a reasonable compromise. Only AC_SUBST a variable
|
||||
dnl if it was not already defined earlier by autoconf.
|
||||
if test "x$datarootdir" = x; then
|
||||
AC_SUBST([datarootdir], ['${datadir}'])
|
||||
fi
|
||||
dnl Copy the approach used in autoconf 2.60.
|
||||
if test "x$docdir" = x; then
|
||||
AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
|
||||
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
|
||||
['${datarootdir}/doc/${PACKAGE}'])])
|
||||
fi
|
||||
dnl The remaining variables missing from autoconf 2.59 are easier.
|
||||
if test "x$htmldir" = x; then
|
||||
AC_SUBST([htmldir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$dvidir" = x; then
|
||||
AC_SUBST([dvidir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$pdfdir" = x; then
|
||||
AC_SUBST([pdfdir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$psdir" = x; then
|
||||
AC_SUBST([psdir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$lispdir" = x; then
|
||||
AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
|
||||
fi
|
||||
if test "x$localedir" = x; then
|
||||
AC_SUBST([localedir], ['${datarootdir}/locale'])
|
||||
fi
|
||||
|
||||
dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
|
||||
dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
|
||||
AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
|
||||
])
|
||||
34
m4/glibc21.m4
Normal file
34
m4/glibc21.m4
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# glibc21.m4 serial 5
|
||||
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2011 Free Software Foundation,
|
||||
dnl 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.
|
||||
|
||||
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
|
||||
# From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_GLIBC21],
|
||||
[
|
||||
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
|
||||
[ac_cv_gnu_library_2_1],
|
||||
[AC_EGREP_CPP([Lucky],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
|
||||
Lucky GNU user
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __UCLIBC__
|
||||
Lucky user
|
||||
#endif
|
||||
],
|
||||
[ac_cv_gnu_library_2_1=yes],
|
||||
[ac_cv_gnu_library_2_1=no])
|
||||
]
|
||||
)
|
||||
AC_SUBST([GLIBC21])
|
||||
GLIBC21="$ac_cv_gnu_library_2_1"
|
||||
]
|
||||
)
|
||||
|
|
@ -27,10 +27,10 @@
|
|||
|
||||
|
||||
# Specification in the form of a command-line invocation:
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen locale log1p maintainer-makefile malloc-gnu malloca nproc open pipe2 putenv recv recvfrom rename send sendto setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar
|
||||
# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nproc open pipe2 putenv recv recvfrom rename send sendto setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar
|
||||
|
||||
# Specification in the form of a few gnulib-tool.m4 macro invocations:
|
||||
gl_LOCAL_DIR([])
|
||||
gl_LOCAL_DIR([gnulib-local])
|
||||
gl_MODULES([
|
||||
accept
|
||||
alignof
|
||||
|
|
@ -73,6 +73,7 @@ gl_MODULES([
|
|||
lib-symbol-visibility
|
||||
libunistring
|
||||
listen
|
||||
localcharset
|
||||
locale
|
||||
log1p
|
||||
maintainer-makefile
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module ceil:
|
||||
# Code from module chdir:
|
||||
# Code from module close:
|
||||
# Code from module configmake:
|
||||
# Code from module connect:
|
||||
# Code from module dirname-lgpl:
|
||||
# Code from module dosname:
|
||||
|
|
@ -112,6 +113,7 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module lib-symbol-visibility:
|
||||
# Code from module libunistring:
|
||||
# Code from module listen:
|
||||
# Code from module localcharset:
|
||||
# Code from module locale:
|
||||
# Code from module log1p:
|
||||
# Code from module lstat:
|
||||
|
|
@ -245,6 +247,7 @@ if test $REPLACE_CLOSE = 1; then
|
|||
AC_LIBOBJ([close])
|
||||
fi
|
||||
gl_UNISTD_MODULE_INDICATOR([close])
|
||||
gl_CONFIGMAKE_PREP
|
||||
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
|
||||
if test "$ac_cv_header_winsock2_h" = yes; then
|
||||
AC_LIBOBJ([connect])
|
||||
|
|
@ -402,6 +405,9 @@ if test "$ac_cv_header_winsock2_h" = yes; then
|
|||
AC_LIBOBJ([listen])
|
||||
fi
|
||||
gl_SYS_SOCKET_MODULE_INDICATOR([listen])
|
||||
gl_LOCALCHARSET
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
|
||||
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
|
||||
gl_LOCALE_H
|
||||
gl_COMMON_DOUBLE_MATHFUNC([log1p])
|
||||
gl_FUNC_LSTAT
|
||||
|
|
@ -778,6 +784,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/canonicalize-lgpl.c
|
||||
lib/ceil.c
|
||||
lib/close.c
|
||||
lib/config.charset
|
||||
lib/connect.c
|
||||
lib/dirname-lgpl.c
|
||||
lib/dirname.h
|
||||
|
|
@ -825,6 +832,8 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/itold.c
|
||||
lib/libunistring.valgrind
|
||||
lib/listen.c
|
||||
lib/localcharset.c
|
||||
lib/localcharset.h
|
||||
lib/locale.in.h
|
||||
lib/lstat.c
|
||||
lib/malloc.c
|
||||
|
|
@ -855,6 +864,8 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/readlink.c
|
||||
lib/recv.c
|
||||
lib/recvfrom.c
|
||||
lib/ref-add.sin
|
||||
lib/ref-del.sin
|
||||
lib/rename.c
|
||||
lib/rmdir.c
|
||||
lib/safe-read.c
|
||||
|
|
@ -924,6 +935,8 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/ceil.m4
|
||||
m4/check-math-lib.m4
|
||||
m4/close.m4
|
||||
m4/codeset.m4
|
||||
m4/configmake.m4
|
||||
m4/dirname.m4
|
||||
m4/double-slash-root.m4
|
||||
m4/duplocale.m4
|
||||
|
|
@ -944,6 +957,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/fstat.m4
|
||||
m4/func.m4
|
||||
m4/getaddrinfo.m4
|
||||
m4/glibc21.m4
|
||||
m4/gnulib-common.m4
|
||||
m4/hostent.m4
|
||||
m4/iconv.m4
|
||||
|
|
@ -969,6 +983,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/lib-prefix.m4
|
||||
m4/libunistring-base.m4
|
||||
m4/libunistring.m4
|
||||
m4/localcharset.m4
|
||||
m4/locale_h.m4
|
||||
m4/longlong.m4
|
||||
m4/lstat.m4
|
||||
|
|
|
|||
17
m4/localcharset.m4
Normal file
17
m4/localcharset.m4
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# localcharset.m4 serial 7
|
||||
dnl Copyright (C) 2002, 2004, 2006, 2009-2011 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.
|
||||
|
||||
AC_DEFUN([gl_LOCALCHARSET],
|
||||
[
|
||||
dnl Prerequisites of lib/localcharset.c.
|
||||
AC_REQUIRE([AM_LANGINFO_CODESET])
|
||||
AC_REQUIRE([gl_FCNTL_O_FLAGS])
|
||||
AC_CHECK_DECLS_ONCE([getc_unlocked])
|
||||
|
||||
dnl Prerequisites of the lib/Makefile.am snippet.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([gl_GLIBC21])
|
||||
])
|
||||
Loading…
Add table
Add a link
Reference in a new issue