summaryrefslogtreecommitdiffstats
path: root/gettext-runtime/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-11-10 23:17:20 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:15:32 +0200
commitce28d1e01757fa71153abeaa9328ad7621222e6b (patch)
tree2371915a3abaca54358c5852782063e9296004c4 /gettext-runtime/m4
parente3f06d95580665f42a3391251166f9e6d3bf6079 (diff)
downloadexternal_gettext-ce28d1e01757fa71153abeaa9328ad7621222e6b.zip
external_gettext-ce28d1e01757fa71153abeaa9328ad7621222e6b.tar.gz
external_gettext-ce28d1e01757fa71153abeaa9328ad7621222e6b.tar.bz2
New file eoverflow.m4, from gnulib.
Diffstat (limited to 'gettext-runtime/m4')
-rw-r--r--gettext-runtime/m4/ChangeLog5
-rw-r--r--gettext-runtime/m4/Makefile.am1
-rw-r--r--gettext-runtime/m4/eoverflow.m470
3 files changed, 76 insertions, 0 deletions
diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog
index 8104644..7f096d6 100644
--- a/gettext-runtime/m4/ChangeLog
+++ b/gettext-runtime/m4/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-10 Bruno Haible <bruno@clisp.org>
+
+ * eoverflow.m4: New file, from gnulib.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2007-11-07 Bruno Haible <bruno@clisp.org>
* gettext-0.17 released.
diff --git a/gettext-runtime/m4/Makefile.am b/gettext-runtime/m4/Makefile.am
index a17c414..afe1e53 100644
--- a/gettext-runtime/m4/Makefile.am
+++ b/gettext-runtime/m4/Makefile.am
@@ -5,6 +5,7 @@
EXTRA_DIST = README \
ansi-c++.m4 \
codeset.m4 \
+eoverflow.m4 \
gettext.m4 \
glibc2.m4 \
glibc21.m4 \
diff --git a/gettext-runtime/m4/eoverflow.m4 b/gettext-runtime/m4/eoverflow.m4
new file mode 100644
index 0000000..3bffd10
--- /dev/null
+++ b/gettext-runtime/m4/eoverflow.m4
@@ -0,0 +1,70 @@
+# eoverflow.m4 serial 2
+dnl Copyright (C) 2004, 2006 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.
+
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX. But some systems (like AIX 3) don't define it, and some systems
+# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+
+# Define EOVERFLOW as a C macro and as a substituted macro in such a way that
+# 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
+# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
+# value.
+
+AC_DEFUN([gl_EOVERFLOW],
+[
+ AC_REQUIRE([AC_PROG_CC])dnl
+
+ AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
+ AC_EGREP_CPP(yes,[
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+ ], have_eoverflow=1)
+ if test -n "$have_eoverflow"; then
+ dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
+ ac_cv_decl_EOVERFLOW=yes
+ else
+ AC_EGREP_CPP(yes,[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+ ], have_eoverflow=1)
+ if test -n "$have_eoverflow"; then
+ dnl EOVERFLOW exists but is hidden.
+ dnl Define it to the same value.
+ AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+])
+ else
+ dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
+ dnl don't define it as EINVAL, because snprintf() callers want to
+ dnl distinguish EINVAL and EOVERFLOW.
+ ac_cv_decl_EOVERFLOW=E2BIG
+ fi
+ fi
+ ])
+ if test "$ac_cv_decl_EOVERFLOW" != yes; then
+ AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
+ [Define as good substitute value for EOVERFLOW.])
+ EOVERFLOW="$ac_cv_decl_EOVERFLOW"
+ AC_SUBST(EOVERFLOW)
+ fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])