diff options
author | Cyril Hrubis <chrubis@suse.cz> | 2014-07-15 11:24:25 +0200 |
---|---|---|
committer | Cyril Hrubis <chrubis@suse.cz> | 2014-07-15 11:24:25 +0200 |
commit | 0ec088f7709dbe7964809771a1f312484d8f577b (patch) | |
tree | adb279035adb254c1315a73ec36fa1b64e6ecd69 /testcases/realtime | |
parent | 5b39d1536d486863e08445dea689df2ec3786529 (diff) |
realtime: Add configure check for GNU exp10()
Closes #13
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'testcases/realtime')
-rw-r--r-- | testcases/realtime/configure.in | 2 | ||||
-rw-r--r-- | testcases/realtime/lib/libstats.c | 6 | ||||
-rw-r--r-- | testcases/realtime/m4/ltp-exp10.m4 | 33 |
3 files changed, 41 insertions, 0 deletions
diff --git a/testcases/realtime/configure.in b/testcases/realtime/configure.in index 79555aaf7..af2cbe4c0 100644 --- a/testcases/realtime/configure.in +++ b/testcases/realtime/configure.in @@ -61,4 +61,6 @@ else fi REALTIME_CHECK_ROBUST_APIS +LTP_CHECK_EXP10 + AC_OUTPUT diff --git a/testcases/realtime/lib/libstats.c b/testcases/realtime/lib/libstats.c index 96090bd15..f12d618f4 100644 --- a/testcases/realtime/lib/libstats.c +++ b/testcases/realtime/lib/libstats.c @@ -46,6 +46,12 @@ #include <libstats.h> #include <librttest.h> +#include "../include/realtime_config.h" + +#ifndef HAVE_EXP10 +# define exp10(x) (exp((x) * log(10))) +#endif + int save_stats = 0; /* static helper functions */ diff --git a/testcases/realtime/m4/ltp-exp10.m4 b/testcases/realtime/m4/ltp-exp10.m4 new file mode 100644 index 000000000..4fe709154 --- /dev/null +++ b/testcases/realtime/m4/ltp-exp10.m4 @@ -0,0 +1,33 @@ +dnl +dnl Copyright (c) Linux Test Project, 2014 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +dnl + +dnl +dnl LTP_CHECK_EXP10 +dnl --------------- +dnl +AC_DEFUN([LTP_CHECK_EXP10],[ +AH_TEMPLATE(HAVE_EXP10, +[Define to 1 if you have 'exp10' function.]) +AC_MSG_CHECKING([for exp10]) +AC_TRY_LINK([#define _GNU_SOURCE + #include <math.h>], + [ + exp10(0.00); + ], + AC_DEFINE(HAVE_EXP10) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) +]) |