aboutsummaryrefslogtreecommitdiff
path: root/m4/intdiv0.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/intdiv0.m4')
-rw-r--r--m4/intdiv0.m463
1 files changed, 39 insertions, 24 deletions
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
index 55dddcf1..afa9acb8 100644
--- a/m4/intdiv0.m4
+++ b/m4/intdiv0.m4
@@ -1,10 +1,8 @@
1# intdiv0.m4 serial 1 (gettext-0.11.3) 1# intdiv0.m4 serial 6 (gettext-0.18.2)
2dnl Copyright (C) 2002 Free Software Foundation, Inc. 2dnl Copyright (C) 2002, 2007-2008, 2010-2014 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU 3dnl This file is free software; the Free Software Foundation
4dnl General Public License. As a special exception to the GNU General 4dnl gives unlimited permission to copy and/or distribute it,
5dnl Public License, this file may be distributed as part of a program 5dnl with or without modifications, as long as this notice is preserved.
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8 6
9dnl From Bruno Haible. 7dnl From Bruno Haible.
10 8
@@ -16,16 +14,28 @@ AC_DEFUN([gt_INTDIV0],
16 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], 14 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
17 gt_cv_int_divbyzero_sigfpe, 15 gt_cv_int_divbyzero_sigfpe,
18 [ 16 [
19 AC_TRY_RUN([ 17 gt_cv_int_divbyzero_sigfpe=
18changequote(,)dnl
19 case "$host_os" in
20 macos* | darwin[6-9]* | darwin[1-9][0-9]*)
21 # On Mac OS X 10.2 or newer, just assume the same as when cross-
22 # compiling. If we were to perform the real test, 1 Crash Report
23 # dialog window would pop up.
24 case "$host_cpu" in
25 i[34567]86 | x86_64)
26 gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
27 esac
28 ;;
29 esac
30changequote([,])dnl
31 if test -z "$gt_cv_int_divbyzero_sigfpe"; then
32 AC_RUN_IFELSE(
33 [AC_LANG_SOURCE([[
20#include <stdlib.h> 34#include <stdlib.h>
21#include <signal.h> 35#include <signal.h>
22 36
23static void 37static void
24#ifdef __cplusplus
25sigfpe_handler (int sig) 38sigfpe_handler (int sig)
26#else
27sigfpe_handler (sig) int sig;
28#endif
29{ 39{
30 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ 40 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
31 exit (sig != SIGFPE); 41 exit (sig != SIGFPE);
@@ -50,23 +60,28 @@ int main ()
50 60
51 z = x / y; 61 z = x / y;
52 nan = y / y; 62 nan = y / y;
53 exit (1); 63 exit (2);
54} 64}
55], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 65]])],
56 [ 66 [gt_cv_int_divbyzero_sigfpe=yes],
57 # Guess based on the CPU. 67 [gt_cv_int_divbyzero_sigfpe=no],
58 case "$host_cpu" in 68 [
59 alpha* | i[34567]86 | m68k | s390*) 69 # Guess based on the CPU.
60 gt_cv_int_divbyzero_sigfpe="guessing yes";; 70changequote(,)dnl
61 *) 71 case "$host_cpu" in
62 gt_cv_int_divbyzero_sigfpe="guessing no";; 72 alpha* | i[34567]86 | x86_64 | m68k | s390*)
63 esac 73 gt_cv_int_divbyzero_sigfpe="guessing yes";;
64 ]) 74 *)
75 gt_cv_int_divbyzero_sigfpe="guessing no";;
76 esac
77changequote([,])dnl
78 ])
79 fi
65 ]) 80 ])
66 case "$gt_cv_int_divbyzero_sigfpe" in 81 case "$gt_cv_int_divbyzero_sigfpe" in
67 *yes) value=1;; 82 *yes) value=1;;
68 *) value=0;; 83 *) value=0;;
69 esac 84 esac
70 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 85 AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
71 [Define if integer division by zero raises signal SIGFPE.]) 86 [Define if integer division by zero raises signal SIGFPE.])
72]) 87])