summaryrefslogtreecommitdiffstats
path: root/libjava/acinclude.m4
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-18 17:06:24 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-18 17:06:24 +0000
commitd3ca31d64b2e347e29aa00733d6d24bd4b9384d4 (patch)
tree39257978d9d699480386ada433ec3ac1e37054d3 /libjava/acinclude.m4
parent58c734f9b2770628c7e14f4c6cb114fe438da268 (diff)
downloadppe42-gcc-d3ca31d64b2e347e29aa00733d6d24bd4b9384d4.tar.gz
ppe42-gcc-d3ca31d64b2e347e29aa00733d6d24bd4b9384d4.zip
For PR java/2812:
* libgcj.spec.in (*lib): Added LIBICONV. * configure: Rebuilt. * configure.in: Call AM_ICONV. Don't check for iconv function. Add parameters to JV_HASH_SYNCHRONIZATION define. * acinclude.m4 (AM_ICONV): New macro, from Bruno Haible. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44116 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/acinclude.m4')
-rw-r--r--libjava/acinclude.m470
1 files changed, 70 insertions, 0 deletions
diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4
index 2559adcccb0..bcccf362a30 100644
--- a/libjava/acinclude.m4
+++ b/libjava/acinclude.m4
@@ -121,3 +121,73 @@ AC_DEFUN([LT_AC_PROG_GCJ],)
AC_SUBST(GCJ)
AC_SUBST(LIBTOOL)
])
+
+#serial AM2
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ AC_ARG_WITH([libiconv-prefix],
+[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
+ done
+ ])
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -liconv"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="-liconv"
+ fi
+ AC_SUBST(LIBICONV)
+])
OpenPOWER on IntegriCloud