changeset 3182:437369541c3d

cexp fix for freebsd.
author Han-Wen Nienhuys <hanwen@lilypond.org>
date Tue, 10 Apr 2007 08:57:03 -0300
parents 4403f922f922
children d496f3a6204a
files patches/guile-cexp.patch specs/guile.py
diffstat 2 files changed, 53 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/guile-cexp.patch	Tue Apr 10 08:57:03 2007 -0300
@@ -0,0 +1,51 @@
+diff --git a/configure.in b/configure.in
+index d2eca30..b574180 100644
+--- a/configure.in
++++ b/configure.in
+@@ -662,6 +662,8 @@ AC_SEARCH_LIBS(crypt, crypt,
+ # for the principal root.
+ #
+ if test "$ac_cv_type_complex_double" = yes; then
++
++  AC_CHECK_FUNCS(cexp clog carg)		         
+   AC_CACHE_CHECK([whether csqrt is usable],
+     guile_cv_use_csqrt,
+     [AC_TRY_RUN([
+diff --git a/libguile/numbers.c b/libguile/numbers.c
+index a0ef29c..36f25a5 100644
+--- a/libguile/numbers.c
++++ b/libguile/numbers.c
+@@ -5997,6 +5997,33 @@ scm_is_number (SCM z)
+   return scm_is_true (scm_number_p (z));
+ }
+ 
++#if !HAVE_CLOG
++complex double clog (complex double z);
++complex double
++clog (complex double z)
++{
++  return log(cabs(z))+I*carg(z);
++}
++#endif
++
++#if !HAVE_CEXP
++complex double cexp (complex double z);
++complex double
++cexp (complex double z)
++{
++  return exp (cabs (z)) * cos(carg (z) + I*sin(carg (z)));
++}
++#endif
++
++#if !HAVE_CARG
++double carg (complex double z);
++double
++carg (complex double z)
++{
++  return atan2 (cimag(z), creal(z));
++}
++#endif
++
+ 
+ /* In the following functions we dispatch to the real-arg funcs like log()
+    when we know the arg is real, instead of just handing everything to
--- a/specs/guile.py	Sun Apr 08 23:50:33 2007 -0300
+++ b/specs/guile.py	Tue Apr 10 08:57:03 2007 -0300
@@ -60,6 +60,7 @@
         ## Don't apply patch twice.
         if None == re.search ('reloc_p=', open (self.expand ('%(srcdir)s/configure.in')).read()):
             self.system ('cd %(srcdir)s && patch -p0 < %(patchdir)s/guile-reloc.patch')
+            self.system ('cd %(srcdir)s && patch -p1 < %(patchdir)s/guile-cexp.patch')
             self.dump ('''#!/bin/sh
 exec %(local_prefix)s/bin/guile "$@"
 ''', "%(srcdir)s/pre-inst-guile.in")
@@ -225,11 +226,6 @@
 class Guile__freebsd (Guile):
     def config_cache_settings (self):
         return Guile.config_cache_settings (self) + '\nac_cv_type_socklen_t=yes'
-
-    def set_mirror(self):
-        self.with (version='1.8.0', mirror=download.gnu, format='gz')
-        self.so_version = '17'
-
     def configure_command (self):
         # watch out for whitespace
         builddir = self.builddir ()
@@ -376,7 +372,7 @@
         self.update_libtool ()
 
     def patch (self):
-        self.autogen_sh()
+        self.autogen_sh ()
         self.autoupdate ()
 
     def install (self):