openat: Ensure autoconf macro ordering.
[pspp] / m4 / signbit.m4
index 233bf2a39a78278a3d0e379618d342214ff15899..1751253944ebce2042079c2f8d421051cf6a08cc 100644 (file)
@@ -1,5 +1,5 @@
-# signbit.m4 serial 6
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# signbit.m4 serial 7
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,8 @@ AC_DEFUN([gl_SIGNBIT],
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <math.h>
 /* If signbit is defined as a function, don't use it, since calling it for
    'float' or 'long double' arguments would involve conversions.
@@ -23,7 +24,9 @@ AC_DEFUN([gl_SIGNBIT],
 #endif
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
-, [gl_cv_func_signbit=yes], [gl_cv_func_signbit=no],
+])],
+        [gl_cv_func_signbit=yes],
+        [gl_cv_func_signbit=no],
         [gl_cv_func_signbit="guessing no"])
     ])
   dnl GCC 4.0 and newer provides three built-ins for signbit.
@@ -32,7 +35,8 @@ AC_DEFUN([gl_SIGNBIT],
   dnl libc.
   AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #if __GNUC__ >= 4
 # define signbit(x) \
    (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
@@ -43,7 +47,9 @@ AC_DEFUN([gl_SIGNBIT],
 #endif
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
-, [gl_cv_func_signbit_gcc=yes], [gl_cv_func_signbit_gcc=no],
+])],
+        [gl_cv_func_signbit_gcc=yes],
+        [gl_cv_func_signbit_gcc=no],
         [gl_cv_func_signbit_gcc="guessing no"])
     ])
   dnl Use the compiler built-ins whenever possible, because they are more
@@ -67,9 +73,11 @@ AC_DEFUN([gl_SIGNBIT],
           AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
             [gl_cv_func_copysignf_no_libm],
             [
-              AC_TRY_LINK([#include <math.h>
-                           float x, y;],
-                          [return copysignf (x, y) < 0;],
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[#include <math.h>
+                     float x, y;]],
+                   [[return copysignf (x, y) < 0;]])],
                 [gl_cv_func_copysignf_no_libm=yes],
                 [gl_cv_func_copysignf_no_libm=no])
             ])
@@ -87,9 +95,11 @@ AC_DEFUN([gl_SIGNBIT],
           AC_CACHE_CHECK([whether copysign can be used without linking with libm],
             [gl_cv_func_copysign_no_libm],
             [
-              AC_TRY_LINK([#include <math.h>
-                           double x, y;],
-                          [return copysign (x, y) < 0;],
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[#include <math.h>
+                     double x, y;]],
+                   [[return copysign (x, y) < 0;]])],
                 [gl_cv_func_copysign_no_libm=yes],
                 [gl_cv_func_copysign_no_libm=no])
             ])
@@ -107,9 +117,11 @@ AC_DEFUN([gl_SIGNBIT],
           AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
             [gl_cv_func_copysignl_no_libm],
             [
-              AC_TRY_LINK([#include <math.h>
-                           long double x, y;],
-                          [return copysignl (x, y) < 0;],
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[#include <math.h>
+                     long double x, y;]],
+                   [[return copysignl (x, y) < 0;]])],
                 [gl_cv_func_copysignl_no_libm=yes],
                 [gl_cv_func_copysignl_no_libm=no])
             ])
@@ -211,7 +223,8 @@ AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION],
   AC_CACHE_CHECK([where to find the sign bit in a '$1'],
     [$2],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 #define NWORDS \
@@ -264,7 +277,7 @@ int main ()
   fprintf (fp, "word %d bit %d", (int) k, (int) i);
   return (fclose (fp) != 0);
 }
-        ],
+        ]])],
         [$2=`cat conftest.out`],
         [$2="unknown"],
         [