From 6a595066f7444ae86941cabf229b12938622faa3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 10 Apr 2007 23:41:17 +0000 Subject: [PATCH] New module 'locale'. --- ChangeLog | 6 ++++++ lib/locale_.h | 29 +++++++++++++++++++++++++++++ m4/locale_h.m4 | 24 ++++++++++++++++++++++++ modules/locale | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 lib/locale_.h create mode 100644 m4/locale_h.m4 create mode 100644 modules/locale diff --git a/ChangeLog b/ChangeLog index ab182fa4f3..cdf4cedb0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-10 Bruno Haible + + * modules/locale: New file. + * lib/locale_.h: New file. + * m4/locale_h.m4: New file. + 2007-04-10 Paul Eggert Bruno Haible diff --git a/lib/locale_.h b/lib/locale_.h new file mode 100644 index 0000000000..7d7d25cf86 --- /dev/null +++ b/lib/locale_.h @@ -0,0 +1,29 @@ +/* A POSIX . + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_LOCALE_H +#define _GL_LOCALE_H + +#include @ABSOLUTE_LOCALE_H@ + +/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C. + On systems that don't define it, use the same value as GNU libintl. */ +#if !defined LC_MESSAGES +# define LC_MESSAGES 1729 +#endif + +#endif /* _GL_LOCALE_H */ diff --git a/m4/locale_h.m4 b/m4/locale_h.m4 new file mode 100644 index 0000000000..57f2f3aa41 --- /dev/null +++ b/m4/locale_h.m4 @@ -0,0 +1,24 @@ +# locale_h.m4 serial 1 +dnl Copyright (C) 2007 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_LOCALE_H], +[ + AC_CACHE_CHECK([whether locale.h conforms to POSIX], + [gl_cv_header_working_locale_h], + [AC_TRY_COMPILE([#include +int x = LC_MESSAGES;], [], + [gl_cv_header_working_locale_h=yes], + [gl_cv_header_working_locale_h=no])]) + if test $gl_cv_header_working_locale_h = yes; then + LOCALE_H= + else + gl_ABSOLUTE_HEADER([locale.h]) + ABSOLUTE_LOCALE_H=\"$gl_cv_absolute_locale_h\" + AC_SUBST([ABSOLUTE_LOCALE_H]) + LOCALE_H=locale.h + fi + AC_SUBST([LOCALE_H]) +]) diff --git a/modules/locale b/modules/locale new file mode 100644 index 0000000000..2110f15dde --- /dev/null +++ b/modules/locale @@ -0,0 +1,36 @@ +Description: +A that conforms to POSIX. + +Files: +lib/locale_.h +m4/locale_h.m4 + +Depends-on: +absolute-header + +configure.ac: +gl_LOCALE_H + +Makefile.am: +BUILT_SOURCES += $(LOCALE_H) + +# We need the following in order to create when the system +# doesn't have one that provides all definitions. +locale.h: locale_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_LOCALE_H''@|$(ABSOLUTE_LOCALE_H)|g' \ + < $(srcdir)/locale_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += locale.h locale.h-t + +Include: + + +License: +LGPL + +Maintainer: +Bruno Haible + -- 2.30.2