Use of powf on UNIX systems without support in -lm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The #define of powf() doesn't work on UNIX systems that don't support
powf() in -lm, like Solaris 2.6 and 7. So, I modified autoconf to detect
powf and modified #ifdef _MSC_VER to substitute the #define powf on
systems that don't support it. Patch attached.

-- 
albert chin (china@xxxxxxxxxxxxxxxxxx)
Index: configure.ac
===================================================================
--- configure.ac.orig	2009-11-29 16:20:24.131528155 +0000
+++ configure.ac	2009-11-29 16:20:38.755484447 +0000
@@ -151,6 +152,17 @@
 dnl Large file support.
 AC_SYS_LARGEFILE
 
+dnl Check for powf().
+AC_MSG_CHECKING([for powf])
+save_LIBS=$LIBS
+LIBS="$LIBS -lm"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
+            [(void)powf(1.0, 1.0);])],
+            [AC_MSG_RESULT([yes])
+             AC_DEFINE(HAVE_POWF, 1, [Define if you have powf()])],
+            [AC_MSG_RESULT([no])])
+LIBS=$save_LIBS
+
 GEGL_VARIADIC_MACROS
 
 AC_MSG_CHECKING([whether to turn on debugging])

Index: operations/generated/math.rb
===================================================================
--- operations/generated/math.rb.orig	2009-11-29 05:44:21.000000000 +0000
+++ operations/generated/math.rb	2009-11-29 05:44:39.675579843 +0000
@@ -65,7 +65,7 @@
 #include \"gegl-chant.h\"
 
 #include <math.h>
-#ifdef _MSC_VER
+#ifndef HAVE_POWF
 #define powf(a,b) ((gfloat)pow(a,b))
 #endif
 
Index: operations/generated/add.c
===================================================================
--- operations/generated/add.c.orig	2009-07-01 16:36:07.000000000 +0000
+++ operations/generated/add.c	2009-11-29 05:46:00.415495430 +0000
@@ -36,7 +36,7 @@
 #include "gegl-chant.h"
 
 #include <math.h>
-#ifdef _MSC_VER
+#ifndef HAVE_POWF
 #define powf(a,b) ((gfloat)pow(a,b))
 #endif
 
Index: operations/generated/divide.c
===================================================================
--- operations/generated/divide.c.orig	2009-07-01 16:36:07.000000000 +0000
+++ operations/generated/divide.c	2009-11-29 05:45:53.553465861 +0000
@@ -36,7 +36,7 @@
 #include "gegl-chant.h"
 
 #include <math.h>
-#ifdef _MSC_VER
+#ifndef HAVE_POWF
 #define powf(a,b) ((gfloat)pow(a,b))
 #endif
 
Index: operations/generated/gamma.c
===================================================================
--- operations/generated/gamma.c.orig	2009-07-01 16:36:07.000000000 +0000
+++ operations/generated/gamma.c	2009-11-29 05:46:05.047021895 +0000
@@ -36,7 +36,7 @@
 #include "gegl-chant.h"
 
 #include <math.h>
-#ifdef _MSC_VER
+#ifndef HAVE_POWF
 #define powf(a,b) ((gfloat)pow(a,b))
 #endif
 
Index: operations/generated/multiply.c
===================================================================
--- operations/generated/multiply.c.orig	2009-07-01 16:36:07.000000000 +0000
+++ operations/generated/multiply.c	2009-11-29 05:45:57.795159318 +0000
@@ -36,7 +36,7 @@
 #include "gegl-chant.h"
 
 #include <math.h>
-#ifdef _MSC_VER
+#ifndef HAVE_POWF
 #define powf(a,b) ((gfloat)pow(a,b))
 #endif
 
Index: operations/generated/subtract.c
===================================================================
--- operations/generated/subtract.c.orig	2009-07-01 16:36:07.000000000 +0000
+++ operations/generated/subtract.c	2009-11-29 05:46:02.711505747 +0000
@@ -36,7 +36,7 @@
 #include "gegl-chant.h"
 
 #include <math.h>
-#ifdef _MSC_VER
+#ifndef HAVE_POWF
 #define powf(a,b) ((gfloat)pow(a,b))
 #endif
 
_______________________________________________
Gegl-developer mailing list
Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux