[vorbis-dev] Patch to get libvorbis 1.0b4 to build on Solaris 2.7

Charles Kerr charles at rebelbase.com
Wed Jun 27 08:51:58 PDT 2001



Apps building against libvorbis 1.0b4 will fail to link on Solaris 2.7
because libvorbis uses atanf, sqrtf, etc., which aren't available on
that platform.

In lib/os.h, there are a couple of workarounds (ifdef DARWIN, ifndef GNUC),
but I'm building on Solaris with gcc, so this doesn't help me any. :)

Attached is a patch to configure.in which checks for sqrtf in libm, and
if it finds it, it uses them in os.h; otherwise, it doesn't use them.
This way configure can do the work instead of #ifdeffing os.h for each
platform.

cheers,
Charles

--- configure.in	Sun Feb 25 22:37:58 2001
+++ ../../libvorbis-1.0beta4/configure.in	Wed Jun 27 10:38:19 2001
@@ -152,6 +152,7 @@
 dnl --------------------------------------------------
 
 AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
+AC_CHECK_LIB(m, sqrtf, AC_DEFINE(HAVE_FLOAT_MATH_LIB), )
 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
 
 AM_PATH_OGG(LIBS="$LIBS $OGG_LIBS", AC_MSG_ERROR(must have Ogg installed!))

--- lib/os.h	Sun Feb 25 22:37:59 2001
+++ ../../libvorbis-1.0beta4/lib/os.h	Wed Jun 27 10:42:30 2001
@@ -38,19 +38,10 @@
 #ifdef _WIN32
 #  include <malloc.h>
 #  define rint(x)   (floor((x)+0.5f)) 
-#  define NO_FLOAT_MATH_LIB
 #  define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
 #endif
 
-#ifndef __GNUC__
-#  define NO_FLOAT_MATH_LIB
-#endif
-
-#ifdef DARWIN
-#  define NO_FLOAT_MATH_LIB
-#endif
-
-#ifndef NO_FLOAT_MATH_LIB
+#ifdef HAVE_FLOAT_MATH_LIB
 #  define sqrt sqrtf
 #  define log logf
 #  define exp expf

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list