This patch to libtool.m4 fixes two problems:

(1) Set ac_compile so the proper compiler and flags are
used when running tests.

(2) Does not set -DPIC is the TAG is GCJ.
-- 
        --Per Bothner
[EMAIL PROTECTED]   http://www.bothner.com/per/
--- libtool.m4~ Thu Feb 28 23:08:04 2002
+++ libtool.m4  Fri Mar  1 12:13:39 2002
@@ -3147,6 +3147,9 @@
 
 # Source file extension for C test sources.
 ac_ext=java
+ac_compile='$GCJ -c $GCJFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
+ac_link='$GCJ -o conftest$ac_exeext $GCJFLAGS $LDFLAGS conftest.$ac_ext $LIBS 
+>&AS_MESSAGE_LOG_FD'
+ac_compiler_gnu=$ac_cv_gcj_compiler_gnu
 
 # Object file extension for compiled C test sources.
 objext=o
@@ -4289,7 +4292,7 @@
 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag 
$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[GCJ],[],[ -DPIC])], [],
     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
      "" | " "*) ;;
      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" 
$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
@@ -4303,7 +4306,7 @@
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
   *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) 
-DPIC"
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, 
+$1)ifelse([$1],[GCJ],[],[ -DPIC])"
     ;;
 esac
 ])

Reply via email to