summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-01-17 17:45:22 +0000
committerBruno Haible <bruno@clisp.org>2001-01-17 17:45:22 +0000
commita7a991ef5dcd4db939e5a90957a431544d1864d8 (patch)
treec4b90b94b9ce88e7b9bb2b97568c1a8909240368 /m4
parent67053507debd8316db3c810227ab721d4eb15e38 (diff)
downloadexternal_gettext-a7a991ef5dcd4db939e5a90957a431544d1864d8.zip
external_gettext-a7a991ef5dcd4db939e5a90957a431544d1864d8.tar.gz
external_gettext-a7a991ef5dcd4db939e5a90957a431544d1864d8.tar.bz2
Since gettext is doesn't translate any more in the C locale, we must use
setlocale() in the testsuite. But since SunOS 4 and other old systems have no other locales than the C locale, we must implement a fake setlocale() ourselves.
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog5
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/setlocale.m426
3 files changed, 32 insertions, 1 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 172e13b..638ee25 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,5 +1,10 @@
2001-01-06 Bruno Haible <haible@clisp.cons.org>
+ * setlocale.m4: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
+2001-01-06 Bruno Haible <haible@clisp.cons.org>
+
* gettext.m4 (AM_WITH_NLS): Look for GNU gettext in libc and libintl,
ignoring Solaris X/Open gettext. Rename cache variables.
diff --git a/m4/Makefile.am b/m4/Makefile.am
index eb744a4..00f37f0 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -8,4 +8,4 @@ aclocal_DATA = gettext.m4 isc-posix.m4 lcmessage.m4 progtest.m4
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
EXTRA_DIST = README \
c-bs-a.m4 codeset.m4 gettext.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 \
-lcmessage.m4 progtest.m4 uintmax_t.m4 ulonglong.m4
+lcmessage.m4 progtest.m4 setlocale.m4 uintmax_t.m4 ulonglong.m4
diff --git a/m4/setlocale.m4 b/m4/setlocale.m4
new file mode 100644
index 0000000..3b400ca
--- /dev/null
+++ b/m4/setlocale.m4
@@ -0,0 +1,26 @@
+#serial 1
+
+# Check for setlocale declaration.
+
+AC_DEFUN(gt_SETLOCALE,[
+AC_CHECK_HEADERS([locale.h])
+AC_MSG_CHECKING([for setlocale declaration])
+AC_CACHE_VAL(gt_cv_proto_setlocale, [
+AC_TRY_COMPILE([
+#include <stdlib.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+char* setlocale (int category, char* locale);
+#else
+char* setlocale();
+#endif
+], [], gt_cv_proto_setlocale_arg1="", gt_cv_proto_setlocale_arg1="const")
+gt_cv_proto_setlocale="extern char* setlocale (int, $gt_cv_proto_setlocale_arg1 char*);"])
+gt_cv_proto_setlocale=`echo "[$]gt_cv_proto_setlocale" | tr -s ' ' | sed -e 's/( /(/'`
+AC_MSG_RESULT([$]{ac_t:-
+ }[$]gt_cv_proto_setlocale)
+AC_DEFINE_UNQUOTED(SETLOCALE_CONST,$gt_cv_proto_setlocale_arg1,
+ [Define as const if the declaration of setlocale() needs const.])
+])