M
Mike Hall
Here's some simple patches to configure.in, configure and math.c
to add the Bessel functions on those systems that have them
in their math library. They were made against 1.8.0 preview 4.
It's probably better to have one #define for all the Bessels,
and avoid the pollution of all the little #define's.
$ diff -p configure.in configure.in.orig
*** configure.in Fri Jul 25 01:03:32 2003
--- configure.in.orig Thu Jul 24 02:37:56 2003
*************** AC_CHECK_FUNCS(fmod killpg wait4 waitpid
*** 373,380 ****
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh \
! j0 j1 y0 y1 jn yn)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need ev
en if obsolete.],
[use_setreuid=$enableval])
--- 373,379 ----
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need ev
en if obsolete.],
[use_setreuid=$enableval])
$ diff -p configure configure.orig
*** configure Fri Jul 25 01:02:15 2003
--- configure.orig Thu Jul 24 02:53:33 2003
*************** for ac_func in fmod killpg wait4 waitpid
*** 10311,10318 ****
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh\
! j0 j1 jn y0 y1 yn
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
--- 10311,10317 ----
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
$ diff -p math.c math.c.orig
*** math.c Fri Jul 25 01:01:47 2003
--- math.c.orig Thu Jul 10 02:36:46 2003
*************** math_erfc(obj, x)
*** 291,347 ****
return rb_float_new(erfc(RFLOAT(x)->value));
}
- #ifdef HAVE_J0
- static VALUE math_j0(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(j0(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_J1
- static VALUE math_j1(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(j1(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_JN
- static VALUE math_jn(VALUE obj, VALUE n, VALUE x)
- {
- Need_Float(x);
- n = rb_Integer(n);
- return rb_float_new(jn(FIX2LONG(n), RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_Y0
- static VALUE math_y0(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(y0(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_Y1
- static VALUE math_y1(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(y1(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_YN
- static VALUE math_yn(VALUE obj, VALUE n, VALUE x)
- {
- Need_Float(x);
- n = rb_Integer(n);
- return rb_float_new(yn(FIX2LONG(n), RFLOAT(x)->value));
- }
- #endif
-
void
Init_Math()
{
--- 291,296 ----
*************** Init_Math()
*** 388,410 ****
rb_define_module_function(rb_mMath, "erf", math_erf, 1);
rb_define_module_function(rb_mMath, "erfc", math_erfc, 1);
-
- #ifdef HAVE_J0
- rb_define_module_function(rb_mMath, "j0", math_j0, 1);
- #endif
- #ifdef HAVE_J1
- rb_define_module_function(rb_mMath, "j1", math_j1, 1);
- #endif
- #ifdef HAVE_JN
- rb_define_module_function(rb_mMath, "jn", math_jn, 2);
- #endif
- #ifdef HAVE_Y0
- rb_define_module_function(rb_mMath, "y0", math_y0, 1);
- #endif
- #ifdef HAVE_Y1
- rb_define_module_function(rb_mMath, "y1", math_y1, 1);
- #endif
- #ifdef HAVE_YN
- rb_define_module_function(rb_mMath, "yn", math_yn, 2);
- #endif
}
--- 337,340 ----
to add the Bessel functions on those systems that have them
in their math library. They were made against 1.8.0 preview 4.
It's probably better to have one #define for all the Bessels,
and avoid the pollution of all the little #define's.
$ diff -p configure.in configure.in.orig
*** configure.in Fri Jul 25 01:03:32 2003
--- configure.in.orig Thu Jul 24 02:37:56 2003
*************** AC_CHECK_FUNCS(fmod killpg wait4 waitpid
*** 373,380 ****
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh \
! j0 j1 y0 y1 jn yn)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need ev
en if obsolete.],
[use_setreuid=$enableval])
--- 373,379 ----
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need ev
en if obsolete.],
[use_setreuid=$enableval])
$ diff -p configure configure.orig
*** configure Fri Jul 25 01:02:15 2003
--- configure.orig Thu Jul 24 02:53:33 2003
*************** for ac_func in fmod killpg wait4 waitpid
*** 10311,10318 ****
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh\
! j0 j1 jn y0 y1 yn
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
--- 10311,10317 ----
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
getpriority getrlimit dlopen sigprocmask sigaction _setjmp\
! setsid telldir seekdir fchmod mktime timegm cosh sinh tanh
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
$ diff -p math.c math.c.orig
*** math.c Fri Jul 25 01:01:47 2003
--- math.c.orig Thu Jul 10 02:36:46 2003
*************** math_erfc(obj, x)
*** 291,347 ****
return rb_float_new(erfc(RFLOAT(x)->value));
}
- #ifdef HAVE_J0
- static VALUE math_j0(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(j0(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_J1
- static VALUE math_j1(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(j1(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_JN
- static VALUE math_jn(VALUE obj, VALUE n, VALUE x)
- {
- Need_Float(x);
- n = rb_Integer(n);
- return rb_float_new(jn(FIX2LONG(n), RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_Y0
- static VALUE math_y0(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(y0(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_Y1
- static VALUE math_y1(VALUE obj, VALUE x)
- {
- Need_Float(x);
- return rb_float_new(y1(RFLOAT(x)->value));
- }
- #endif
-
- #ifdef HAVE_YN
- static VALUE math_yn(VALUE obj, VALUE n, VALUE x)
- {
- Need_Float(x);
- n = rb_Integer(n);
- return rb_float_new(yn(FIX2LONG(n), RFLOAT(x)->value));
- }
- #endif
-
void
Init_Math()
{
--- 291,296 ----
*************** Init_Math()
*** 388,410 ****
rb_define_module_function(rb_mMath, "erf", math_erf, 1);
rb_define_module_function(rb_mMath, "erfc", math_erfc, 1);
-
- #ifdef HAVE_J0
- rb_define_module_function(rb_mMath, "j0", math_j0, 1);
- #endif
- #ifdef HAVE_J1
- rb_define_module_function(rb_mMath, "j1", math_j1, 1);
- #endif
- #ifdef HAVE_JN
- rb_define_module_function(rb_mMath, "jn", math_jn, 2);
- #endif
- #ifdef HAVE_Y0
- rb_define_module_function(rb_mMath, "y0", math_y0, 1);
- #endif
- #ifdef HAVE_Y1
- rb_define_module_function(rb_mMath, "y1", math_y1, 1);
- #endif
- #ifdef HAVE_YN
- rb_define_module_function(rb_mMath, "yn", math_yn, 2);
- #endif
}
--- 337,340 ----