This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Lack of fabsf on Solaris (patch included)


Hi,
there is no fabsf on Solaris machines.

The appended patch removed the problem, but i assume it was
by accident.  

I tried it on linux (which has fabsf) and got a 
/* #undef HAVE_FABSF */
in i686-pc-linux-gnu/libjava/include/config.h

Any idea, why this patch doesn't do what it should?
(Perhaps it's just a missing autoconf in libjava - I'll try
another build now).

I applied the following patch and built it with
configure --prefix=${prefix} --enable-languages=c++,f77,java \
          --enable-threads=posix --enable-libstdcxx-v3 \
          --with-gnu-as --with-gnu-ld
gmake && gmake install

Bye,
Martin.

Here is the patch:

diff -cr gcc-20010122/configure.in gcc-20010122.new/configure.in
*** gcc-20010122/configure.in	Mon Jan 22 02:47:11 2001
--- gcc-20010122.new/configure.in	Thu Jan 25 10:09:00 2001
***************
*** 951,957 ****
      noconfigdirs="${libgcj}"
      ;;    
    *-*-*)
!     noconfigdirs="${libgcj}"
      ;;
  esac
  
--- 951,957 ----
      noconfigdirs="${libgcj}"
      ;;    
    *-*-*)
!     noconfigdirs=""
      ;;
  esac
  
diff -cr gcc-20010122/libjava/configure.in gcc-20010122.new/libjava/configure.in
*** gcc-20010122/libjava/configure.in	Fri Jan 12 20:16:04 2001
--- gcc-20010122.new/libjava/configure.in	Wed Jan 24 16:20:59 2001
***************
*** 165,170 ****
--- 165,171 ----
  AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
  AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
  AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
+ AC_EGREP_HEADER(fabsf, math.h, AC_DEFINE(HAVE_FABSF))
  
  
  dnl These may not be defined in a non-ANS conformant embedded system.
diff -cr gcc-20010122/libjava/include/config.h.in gcc-20010122.new/libjava/include/config.h.in
*** gcc-20010122/libjava/include/config.h.in	Fri Jan 12 20:16:05 2001
--- gcc-20010122.new/libjava/include/config.h.in	Thu Jan 25 11:22:39 2001
***************
*** 52,57 ****
--- 52,60 ----
  /* Define if you have u_int32_t */
  #undef HAVE_BSD_INT32_DEFINED
  
+ /* Define if you have fabsf */
+ #undef HAVE_FABSF
+ 
  /* Define if you're running eCos. */
  #undef ECOS
  
diff -cr gcc-20010122/libjava/java/lang/natMath.cc gcc-20010122.new/libjava/java/lang/natMath.cc
*** gcc-20010122/libjava/java/lang/natMath.cc	Sat Dec  2 01:28:44 2000
--- gcc-20010122.new/libjava/java/lang/natMath.cc	Wed Jan 24 16:20:37 2001
***************
*** 27,33 ****
--- 27,35 ----
  
  #include "fdlibm.h"
  
+ #ifdef HAVE_FABSF
  extern "C" float fabsf (float);
+ #endif
  
  jdouble java::lang::Math::cos(jdouble x)
  {
***************
*** 96,102 ****
--- 98,108 ----
  
  jfloat java::lang::Math::abs(jfloat x)
  {
+ #ifdef HAVE_FABSF
    return (jfloat)::fabsf((float)x);
+ #else
+   return (jfloat)::fabs((double)x);
+ #endif
  }  
  
  jdouble java::lang::Math::rint(jdouble x)


-- 
The early bird gets the worm. If you want something else for       
breakfast, get up later.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]