summaryrefslogtreecommitdiffstats
path: root/m4/setlocale.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/setlocale.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/setlocale.m4')
-rw-r--r--m4/setlocale.m426
1 files changed, 26 insertions, 0 deletions
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.])
+])