Subject: pkg/36555: lang/guile 1.8.1: link error on FreeBSD 6.2-STABLE
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <alnsn@yandex.ru>
List: pkgsrc-bugs
Date: 06/25/2007 16:20:01
>Number:         36555
>Category:       pkg
>Synopsis:       lang/guile 1.8.1: link error on FreeBSD 6.2-STABLE
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 25 16:20:01 +0000 2007
>Originator:     Alexander Nasonov
>Release:        
>Organization:
>Environment:
FreeBSD fbx1000 6.2-STABLE FreeBSD 6.2-STABLE #0: Fri Feb  2 01:35:39 MSK 2007     alnsn@fbx1000:/home/obj/MAKEOBJDIRPREFIX/usr/src/sys/GENERIC  i386
>Description:
cexp and clog functions are not implemented in FreeBSD 6.2-STABLE. Autoconf script of guile 1.8.1 doesn't check for these functions. Attached patch fixes this problem.
>How-To-Repeat:
$ cd lang/guile
$ bmake
>Fix:
>From (http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-scheme/guile/files/guile-1.8.1-clog-cexp.patch?rev=1.1&view=markup):

Index: guile-1.8.1/configure.in
===================================================================
--- guile-1.8.1.orig/configure.in
+++ guile-1.8.1/configure.in
@@ -602,6 +602,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h
 #       (DINFINITY and DQNAN are actually global variables, not functions)
 #   chsize - an MS-DOS-ism, found in mingw
 #   clog10 - not in mingw (though others like clog and csqrt are)
+#   clog,cexp - not in FreeBSD (though others are, like cabs)
 #   fesetround - available in C99, but not older systems
 #   ftruncate - posix, but probably not older systems (current mingw
 #               has it as an inline for chsize)
@@ -614,7 +615,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h
 #   isblank - available as a GNU extension or in C99
 #   _NSGetEnviron - Darwin specific
 #
-AC_CHECK_FUNCS([DINFINITY DQNAN chsize clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice readdir_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron])
+AC_CHECK_FUNCS([DINFINITY DQNAN chsize clog10 clog cexp ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice readdir_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron])
 
 # Reasons for testing:
 #   netdb.h - not in mingw
Index: guile-1.8.1/libguile/numbers.c
===================================================================
--- guile-1.8.1.orig/libguile/numbers.c
+++ guile-1.8.1/libguile/numbers.c
@@ -6018,7 +6018,7 @@ SCM_DEFINE (scm_log, "log", 1, 0, 0,
 {
   if (SCM_COMPLEXP (z))
     {
-#if HAVE_COMPLEX_DOUBLE
+#if HAVE_COMPLEX_DOUBLE && HAVE_CLOG
       return scm_from_complex_double (clog (SCM_COMPLEX_VALUE (z)));
 #else
       double re = SCM_COMPLEX_REAL (z);
@@ -6084,7 +6084,7 @@ SCM_DEFINE (scm_exp, "exp", 1, 0, 0,
 {
   if (SCM_COMPLEXP (z))
     {
-#if HAVE_COMPLEX_DOUBLE
+#if HAVE_COMPLEX_DOUBLE && HAVE_CEXP
       return scm_from_complex_double (cexp (SCM_COMPLEX_VALUE (z)));
 #else
       return scm_c_make_polar (exp (SCM_COMPLEX_REAL (z)),