From 3f104ab36e50f607fdf9f645d68ac6118814ab22 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 26 Feb 2007 04:52:23 +0000 Subject: [PATCH] Improve portability to NetBSD and Alpha. --- ChangeLog | 12 ++++++++++++ acinclude.m4 | 6 +++--- configure.ac | 5 +++-- src/ui/terminal/ChangeLog | 9 +++++++++ src/ui/terminal/main.c | 6 ++++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2247ab48..57f6461d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-02-25 Ben Pfaff + + Thanks to Jason Stover for verifying that this patch helps under + NetBSD. + + * acinclude.m4: Rename PSPP_ENABLE_WARNING to PSPP_ENABLE_OPTION, + because it's useful for more than warnings. + + * configure.ac: Add PSPP_ENABLE_OPTION(-mieee) to improve IEEE + floating-point conformance on Alpha and SH architectures. Also, + check for fpsetmask function (available on BSDs). + Mon Feb 19 10:52:21 2007 Ben Pfaff * Smake (GNULIB_MODULES): Add dirname module, remove canonicalize diff --git a/acinclude.m4 b/acinclude.m4 index e15ab767..5f358087 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -63,10 +63,10 @@ AC_DEFUN([PSPP_OFF_T], `--disable-largefile' or `CFLAGS=-ansi'.])]) ]) -dnl Check whether a warning flag is accepted. +dnl Check whether a C compiler option is accepted. dnl If so, add it to CFLAGS. -dnl Example: PSPP_ENABLE_WARNING(-Wdeclaration-after-statement) -AC_DEFUN([PSPP_ENABLE_WARNING], +dnl Example: PSPP_ENABLE_OPTION(-Wdeclaration-after-statement) +AC_DEFUN([PSPP_ENABLE_OPTION], [ m4_define([pspp_cv_name], [pspp_cv_[]m4_translit([$1], [-], [_])])dnl AC_CACHE_CHECK([whether $CC accepts $1], [pspp_cv_name], diff --git a/configure.ac b/configure.ac index 16a2e471..fec518d4 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,8 @@ AM_PROG_CC_C_O AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL -PSPP_ENABLE_WARNING(-Wdeclaration-after-statement) +PSPP_ENABLE_OPTION(-Wdeclaration-after-statement) +PSPP_ENABLE_OPTION(-mieee) AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" ) @@ -80,7 +81,7 @@ AC_DEFINE(FPREP_IEEE754, 1, AC_C_BIGENDIAN AC_FUNC_VPRINTF -AC_CHECK_FUNCS([__setfpucw execl fork isinf isnan finite getpid feholdexcept popen round trunc]) +AC_CHECK_FUNCS([__setfpucw execl fork isinf isnan finite getpid feholdexcept fpsetmask popen round trunc]) AC_PROG_LN_S diff --git a/src/ui/terminal/ChangeLog b/src/ui/terminal/ChangeLog index a02521da..ad09bff3 100644 --- a/src/ui/terminal/ChangeLog +++ b/src/ui/terminal/ChangeLog @@ -1,3 +1,12 @@ +2007-02-25 Ben Pfaff + + Thanks to Jason Stover for verifying that this patch helps under + NetBSD. + + * main.c [HAVE_IEEE_FP]: Include . + (fpu_init) [HAVE_IEEE_FP]: Use setfpmask to mask floating-point + exceptions. + Sun Feb 18 13:28:26 2007 Ben Pfaff * msg-ui.c: Don't include exit.h, because gnulib fixes up stdlib.h diff --git a/src/ui/terminal/main.c b/src/ui/terminal/main.c index 2f7d1fbe..e2cd180d 100644 --- a/src/ui/terminal/main.c +++ b/src/ui/terminal/main.c @@ -58,6 +58,10 @@ #include #endif +#if HAVE_IEEEFP_H +#include +#endif + #include "gettext.h" #define _(msgid) gettext (msgid) @@ -158,6 +162,8 @@ fpu_init (void) feholdexcept (&foo); #elif HAVE___SETFPUCW && defined(_FPU_IEEE) __setfpucw (_FPU_IEEE); +#elif HAVE_FPSETMASK + fpsetmask (0); #endif } -- 2.30.2