diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-12-23 21:21:00 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-12-23 21:21:00 +0300 |
commit | 7086d3c37dc564e7a5b7ecf5e1a8065e98eab574 (patch) | |
tree | 2cbcc02450278aad1e5bda8e1b16bc7a354125cb | |
parent | 85473df0d4ebff637216cfe0c13bcc70c7ed5a56 (diff) | |
download | libatomic_ops-7086d3c37dc564e7a5b7ecf5e1a8065e98eab574.tar.gz |
Replace obsolete AC_TRY_COMPILE with AC_COMPILE_IFELSE in configure
(refactoring)
* configure.ac (AC_TRY_COMPILE): Replace with
AC_COMPILE_IFELSE(AC_LANG_SOURCE).
-rw-r--r-- | configure.ac | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index ae30859..87d9f9b 100644 --- a/configure.ac +++ b/configure.ac @@ -53,11 +53,12 @@ if test "$GCC" = yes; then # Workaround: at least GCC 3.4.6 (Solaris) does not define this macro. old_CFLAGS="$CFLAGS" CFLAGS="$PICFLAG $CFLAGS" - AC_TRY_COMPILE([],[ + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([ #ifndef __PIC__ # error #endif - ], [ac_cv_pic_macro=yes], [ac_cv_pic_macro=no]) + ])], [ac_cv_pic_macro=yes], [ac_cv_pic_macro=no]) CFLAGS="$old_CFLAGS" AC_MSG_RESULT($ac_cv_pic_macro) AS_IF([test "$ac_cv_pic_macro" = yes], [], @@ -69,15 +70,16 @@ if test "$GCC" = yes; then AC_MSG_CHECKING([whether compiler supports -Wextra]) old_CFLAGS="$CFLAGS" CFLAGS="-Wextra $CFLAGS" - AC_TRY_COMPILE([],[], [ac_cv_cc_wextra=yes], [ac_cv_cc_wextra=no]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], + [ac_cv_cc_wextra=yes], [ac_cv_cc_wextra=no]) CFLAGS="$old_CFLAGS" AC_MSG_RESULT($ac_cv_cc_wextra) AS_IF([test "$ac_cv_cc_wextra" = yes], [WEXTRA="-Wextra"], [WEXTRA="-W"]) AC_MSG_CHECKING([whether compiler supports -Wpedantic]) CFLAGS="-Wpedantic -Wno-long-long $CFLAGS" - AC_TRY_COMPILE([],[ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ extern int quiet; - ], [ac_cv_cc_pedantic=yes], [ac_cv_cc_pedantic=no]) + ])], [ac_cv_cc_pedantic=yes], [ac_cv_cc_pedantic=no]) CFLAGS="$old_CFLAGS" AC_MSG_RESULT($ac_cv_cc_pedantic) WPEDANTIC= |