~ubuntu-branches/ubuntu/hardy/autoconf-archive/hardy

« back to all changes in this revision

Viewing changes to m4source/ac_cxx_have_system_v_math.m4

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2004-06-26 09:43:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040626094357-3be3jwcz1vcdhpe8
Tags: upstream-20040616
ImportĀ upstreamĀ versionĀ 20040616

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Available from the GNU Autoconf Macro Archive at:
 
2
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_system_v_math.html
 
3
dnl
 
4
AC_DEFUN([AC_CXX_HAVE_SYSTEM_V_MATH],
 
5
[AC_CACHE_CHECK(whether the compiler supports System V math library,
 
6
ac_cv_cxx_have_system_v_math,
 
7
[AC_LANG_SAVE
 
8
 AC_LANG_CPLUSPLUS
 
9
 ac_save_LIBS="$LIBS"
 
10
 LIBS="$LIBS -lm"
 
11
 AC_TRY_LINK([
 
12
#ifndef _ALL_SOURCE
 
13
 #define _ALL_SOURCE
 
14
#endif
 
15
#ifndef _XOPEN_SOURCE
 
16
 #define _XOPEN_SOURCE
 
17
#endif
 
18
#ifndef _XOPEN_SOURCE_EXTENDED
 
19
 #define _XOPEN_SOURCE_EXTENDED 1
 
20
#endif
 
21
#include <math.h>],[double x = 1.0; double y = 1.0;
 
22
_class(x); ilogb(x); itrunc(x); nearest(x); rsqrt(x); uitrunc(x);
 
23
copysign(x,y); drem(x,y); fmod(x,y); hypot(x,y); nextafter(x,y);
 
24
remainder(x,y); scalb(x,y); unordered(x,y);
 
25
return 0;],
 
26
 ac_cv_cxx_have_system_v_math=yes, ac_cv_cxx_have_system_v_math=no)
 
27
 LIBS="$ac_save_LIBS"
 
28
 AC_LANG_RESTORE
 
29
])
 
30
if test "$ac_cv_cxx_have_system_v_math" = yes; then
 
31
  AC_DEFINE(HAVE_SYSTEM_V_MATH,,[define if the compiler supports System V math library])
 
32
fi
 
33
])