[Java patch] AM_ICONV fix

Craig Rodrigues rodrigc@mediaone.net
Sun Jan 27 15:25:00 GMT 2002


Hi,

I already applied this patch in the gcc directory.
Is it OK for the java directory as well?
It deals with PR 4972, when someone configures
with --with-libiconv-prefix=DIR. 

2002-01-22  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 
        PR java/4972
        * aclocal.m4 (AM_ICONV): Put linking flags for libiconv
        in LIBICONV variable.
        * configure: Regenerated.

Index: aclocal.m4
===================================================================
RCS file: /cvs/gcc/gcc/libjava/aclocal.m4,v
retrieving revision 1.21
diff -u -r1.21 aclocal.m4
--- aclocal.m4	2002/01/11 23:00:56	1.21
+++ aclocal.m4	2002/01/27 23:06:54
@@ -143,11 +143,12 @@
   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
   dnl those with the standalone portable GNU libiconv installed).
 
+  am_cv_lib_iconv_ldpath=
   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
+      if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
     done
    ])
 
@@ -162,7 +163,7 @@
       am_cv_func_iconv=yes)
     if test "$am_cv_func_iconv" != yes; then
       am_save_LIBS="$LIBS"
-      LIBS="$LIBS -liconv"
+      LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
       AC_TRY_LINK([#include <stdlib.h>
 #include <iconv.h>],
         [iconv_t cd = iconv_open("","");
@@ -199,7 +200,7 @@
   fi
   LIBICONV=
   if test "$am_cv_lib_iconv" = yes; then
-    LIBICONV="-liconv"
+    LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
   fi
   AC_SUBST(LIBICONV)
 ])


-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          



More information about the Java-patches mailing list