diff options
author | Peter Kokot <peterkokot@gmail.com> | 2018-07-26 08:47:57 +0200 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2018-07-26 08:47:57 +0200 |
commit | c404836774557b5c660a9baaa82bdaa793b95927 (patch) | |
tree | db2106ce8b2d6b8e81f283733034997a9ff0836b /m4/ax_cxx_have_system_v_math.m4 | |
parent | 72e8def2648d7d05daa95d533079e7373b7218d7 (diff) | |
download | autoconf-archive-c404836774557b5c660a9baaa82bdaa793b95927.tar.gz |
Replace AC_TRY_LINK and AC_LANG_
Autoconf 2.50 in 2001 made several macros obsolete. These include macros
for temporary changing the language - AC_LANG_SAVE, AC_LANG_CPLUSPLUS,
and AC_LANG_RESTORE. Instead of these the AC_LANG_PUSH and
AC_LANG_POP macros should be used with later Autoconf versions.
AC_TRY_LINK macros should be replaced with AC_LINK_IFELSE and
AC_LANG_PROGRAM.
Refs:
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Language-Choice.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
Diffstat (limited to 'm4/ax_cxx_have_system_v_math.m4')
-rw-r--r-- | m4/ax_cxx_have_system_v_math.m4 | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/m4/ax_cxx_have_system_v_math.m4 b/m4/ax_cxx_have_system_v_math.m4 index 56b3dc0..fd10860 100644 --- a/m4/ax_cxx_have_system_v_math.m4 +++ b/m4/ax_cxx_have_system_v_math.m4 @@ -22,17 +22,16 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AC_CXX_HAVE_SYSTEM_V_MATH], [AX_CXX_HAVE_SYSTEM_V_MATH]) AC_DEFUN([AX_CXX_HAVE_SYSTEM_V_MATH], [AC_CACHE_CHECK(whether the compiler supports System V math library, ax_cv_cxx_have_system_v_math, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS +[AC_LANG_PUSH([C++]) ac_save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifndef _ALL_SOURCE #define _ALL_SOURCE #endif @@ -42,13 +41,13 @@ ax_cv_cxx_have_system_v_math, #ifndef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #endif -#include <math.h>],[double x = 1.0; double y = 1.0; +#include <math.h>]], [[double x = 1.0; double y = 1.0; _class(x); trunc(x); finite(x); itrunc(x); nearest(x); rsqrt(x); uitrunc(x); copysign(x,y); drem(x,y); unordered(x,y); -return 0;], - ax_cv_cxx_have_system_v_math=yes, ax_cv_cxx_have_system_v_math=no) +return 0;]])], + [ax_cv_cxx_have_system_v_math=yes], [ax_cv_cxx_have_system_v_math=no]) LIBS="$ac_save_LIBS" - AC_LANG_RESTORE + AC_LANG_POP([C++]) ]) if test "$ax_cv_cxx_have_system_v_math" = yes; then AC_DEFINE(HAVE_SYSTEM_V_MATH,,[define if the compiler supports System V math library]) |