diff --git a/jtag/ChangeLog b/jtag/ChangeLog index ba5a8887..1cfce61e 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,5 +1,9 @@ 2008-06-11 Arnim Laeuger + * src/tap/cable/generic.c (fmax): define fallback in case libm doesn't + provide fmax() + * configure.ac: detect availability of fmax() in libm + * src/bus/bf548_ezkit.c, src/bus/ppc405ep.c, src/bus/sh7727.c, src/bus/sa1110.c, src/bus/ppc440gx_ebc8.c, src/bus/tx4925.c, src/bus/sh7750r.c, src/bus/pxa2x0.c, src/bus/bf533_stamp.c, diff --git a/jtag/configure.ac b/jtag/configure.ac index d07b8f76..646f4ac6 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -540,6 +540,13 @@ AS_IF([test "x$relocatable" = xyes], [ AM_CONDITIONAL(JTAG_RELOCATABLE, false) ]) + +dnl Is fmax() provided by libm? +AC_CHECK_LIB([m], [fmax], [ + AC_DEFINE(HAVE_FMAX, 1, [Define if -lm provides fmax()]) +]) + + AC_OUTPUT dnl diff --git a/jtag/src/tap/cable/generic.c b/jtag/src/tap/cable/generic.c index 251f9226..d178bfdf 100644 --- a/jtag/src/tap/cable/generic.c +++ b/jtag/src/tap/cable/generic.c @@ -39,6 +39,13 @@ #include + +#ifndef HAVE_FMAX +/* workaround for libm implementations that don't provide the fmax() function */ +#define fmax(_f1_,_f2_) ( (_f1_) > (_f2_) ? (_f1_) : (_f2_) ) +#endif + + #undef VERBOSE #ifdef VERBOSE