projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
strtoimax: Avoid link error on OSF/1 with DTK cc.
[gnulib.git]
/
m4
/
iconv.m4
diff --git
a/m4/iconv.m4
b/m4/iconv.m4
index
b7f5bfe
..
085cd06
100644
(file)
--- a/
m4/iconv.m4
+++ b/
m4/iconv.m4
@@
-1,5
+1,5
@@
-# iconv.m4 serial 1
1c
-dnl Copyright (C) 2000-2002, 2007-201
0
Free Software Foundation, Inc.
+# iconv.m4 serial 1
7 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-201
1
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 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.
@@
-72,11
+72,13
@@
AC_DEFUN([AM_ICONV_LINK],
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <iconv.h>
#include <string.h>
int main ()
{
#include <iconv.h>
#include <string.h>
int main ()
{
+ int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
@@
-93,7
+95,8
@@
int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
- return 1;
+ result |= 1;
+ iconv_close (cd_utf8_to_88591);
}
}
/* Test against Solaris 10 bug: Failures are not distinguishable from
}
}
/* Test against Solaris 10 bug: Failures are not distinguishable from
@@
-112,7
+115,8
@@
int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
- return 1;
+ result |= 2;
+ iconv_close (cd_ascii_to_88591);
}
}
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
}
}
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
@@
-130,7
+134,8
@@
int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
- return 1;
+ result |= 4;
+ iconv_close (cd_88591_to_utf8);
}
}
#if 0 /* This bug could be worked around by the caller. */
}
}
#if 0 /* This bug could be worked around by the caller. */
@@
-149,7
+154,8
@@
int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
- return 1;
+ result |= 8;
+ iconv_close (cd_88591_to_utf8);
}
}
#endif
}
}
#endif
@@
-163,9
+169,11
@@
int main ()
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
/* Try HP-UX names. */
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
/* Try HP-UX names. */
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
- return 1;
- return 0;
-}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
+ result |= 16;
+ return result;
+}]])],
+ [am_cv_func_iconv_works=yes],
+ [am_cv_func_iconv_works=no],
[
changequote(,)dnl
case "$host_os" in
[
changequote(,)dnl
case "$host_os" in
@@
-214,8
+222,11
@@
m4_define([gl_iconv_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
- [[AC_DEFUN(
- [$1], [$2])]]))
+ [m4_ifdef([gl_00GNULIB],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]])]))
gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
@@
-246,5
+257,12
@@
size_t iconv();
$am_cv_proto_iconv])
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
$am_cv_proto_iconv])
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
+ dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+ m4_ifdef([gl_ICONV_H_DEFAULTS],
+ [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+ ])
fi
])
fi
])