From 45722f06c9f31628ae7010fff2336f6c74432351 Mon Sep 17 00:00:00 2001 From: Fabrizio Fabbri Date: Mon, 23 Oct 2017 00:40:37 -0400 Subject: [PATCH] Fix #410 link error as feenableexcept not present on OSX. --- src/configure | 76 ++------------------------------------------- src/configure.ac | 7 ++--- src/ecl/configpre.h | 6 +--- 3 files changed, 7 insertions(+), 82 deletions(-) diff --git a/src/configure b/src/configure index 2622bb4bf..dd8e00a65 100755 --- a/src/configure +++ b/src/configure @@ -737,7 +737,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -867,7 +866,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1120,15 +1118,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1266,7 +1255,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1419,7 +1408,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2217,52 +2205,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t - -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -9445,23 +9387,11 @@ _ACEOF fi done +ac_fn_c_check_func "$LINENO" "feenableexcept" "ac_cv_func_feenableexcept" +if test "x$ac_cv_func_feenableexcept" = xyes; then : $as_echo "#define HAVE_FEENABLEEXCEPT /**/" >>confdefs.h -ac_fn_c_check_decl "$LINENO" "feenableexcept" "ac_cv_have_decl_feenableexcept" "#include -" -if test "x$ac_cv_have_decl_feenableexcept" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEENABLEEXCEPT $ac_have_decl -_ACEOF -if test $ac_have_decl = 1; then : - $as_echo "#define HAVE_FEENABLEEXCEPT 1" >>confdefs.h -, , HAVE_FEENABLEEXCEPT else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: feenableexcept not declared: disabling floating point exceptions" >&5 $as_echo "$as_me: WARNING: feenableexcept not declared: disabling floating point exceptions" >&2;} diff --git a/src/configure.ac b/src/configure.ac index c9a8faba2..b97d4e953 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -749,10 +749,9 @@ dnl !!! end autoscan AC_CHECK_FUNCS( [nanosleep alarm times select setenv putenv] \ [lstat mkstemp sigprocmask isatty tzset] \ [gettimeofday getrusage] ) -AC_DEFINE([HAVE_FEENABLEEXCEPT], [], [Description]) -AC_CHECK_DECLS([feenableexcept], - [AC_DEFINE(HAVE_FEENABLEEXCEPT), [], [HAVE_FEENABLEEXCEPT]], - [AC_MSG_WARN(feenableexcept not declared: disabling floating point exceptions)], [#include ]) +AC_CHECK_FUNC([feenableexcept], + [AC_DEFINE(HAVE_FEENABLEEXCEPT,[],[feenableexcept is available])], + [AC_MSG_WARN(feenableexcept not provided: disabling floating point exceptions)]) AC_CHECK_FUNCS( [expf logf sqrtf cosf sinf tanf sinhf coshf tanhf] \ [floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl] \ diff --git a/src/ecl/configpre.h b/src/ecl/configpre.h index 1fdfb2a75..b035be7e5 100644 --- a/src/ecl/configpre.h +++ b/src/ecl/configpre.h @@ -102,10 +102,6 @@ /* Define to 1 if you have the `cosl' function. */ #undef HAVE_COSL -/* Define to 1 if you have the declaration of `feenableexcept', and to 0 if - you don't. */ -#undef HAVE_DECL_FEENABLEEXCEPT - /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H @@ -133,7 +129,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Description */ +/* feenableexcept is available */ #undef HAVE_FEENABLEEXCEPT /* Define to 1 if you have the header file. */