diff options
Diffstat (limited to 'kcalc/configure.in.in')
-rw-r--r-- | kcalc/configure.in.in | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/kcalc/configure.in.in b/kcalc/configure.in.in new file mode 100644 index 0000000..3501f1e --- /dev/null +++ b/kcalc/configure.in.in @@ -0,0 +1,78 @@ +AC_CHECK_HEADERS(ieeefp.h) + +AC_CHECK_FUNCS(fabsl) + +AC_DEFUN([KDE_C_LONG_DOUBLE], +[ + AC_CACHE_CHECK(for long double, ac_cv_c_long_double, + [ + ac_save_LIBS="$LIBS" + LIBS="-lm $LIBS" + AC_TRY_RUN( + [ +#define _ISOC99_SOURCE 1 +#define _GNU_SOURCE 1 +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +int main() { +/* The Stardent Vistra knows sizeof(long double), but does not support it. */ +long double foo = 1.0; +char buffer[10]; +/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ +int result = (sizeof(long double) <= sizeof(double)); +/* the following is needed for a broken printf in glibc2 */ +if (!result) { + foo = foo * 3; + sprintf(buffer,"%0.0Lf",foo); + result = strcmp(buffer, "3"); +/* and now something mean ;-) */ + foo = powl(fabsl(foo), 1); +} +exit(result); } + ], + ac_cv_c_long_double=yes, ac_cv_c_long_double=no, + ac_cv_c_long_double=no + ) + LIBS="$ac_save_LIBS" + ]) + if test $ac_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have support for long double in printf]) + fi +]) +KDE_C_LONG_DOUBLE + +have_l_funcs=yes +AC_CHECK_LIB(m, asinl,,have_l_funcs=no) +AC_CHECK_LIB(m, sqrtl,,have_l_funcs=no) + +if test "xyes" = "x$have_l_funcs" ; then + AC_DEFINE(HAVE_L_FUNCS,1,[Define if you have *l math functions (absl, ...)]) +fi + +AC_LANG_C +AC_CHECK_LIB(m, isinf, [ + AC_DEFINE_UNQUOTED(HAVE_FUNC_ISINF, 1, [Define if you have isinf]) +]) +AC_CHECK_LIB(m, round, [ + AC_DEFINE_UNQUOTED(HAVE_FUNC_ROUND, 1, [Define if you have round]) +]) +AC_CHECK_LIB(m, roundl, [ + AC_DEFINE_UNQUOTED(HAVE_FUNC_ROUNDL, 1, [Define if you have round]) +]) + +kcalc_gmp_found=yes +LIBGMP= +KDE_CHECK_HEADER([gmp.h], [ + KDE_CHECK_LIB(gmp, main, [ + LIBGMP="-lgmp" + AC_DEFINE(HAVE_GMP, 1, [Define if you have libgmp]) + ]) + ],[ + DO_NOT_COMPILE="kcalc $DO_NOT_COMPILE" + kcalc_gmp_found=no + ] +) +AC_SUBST(LIBGMP) |