Skip to content

Commit c5db991

Browse files
Use AX_CHECK_COMPILE_FLAG
1 parent a4180ed commit c5db991

File tree

2 files changed

+64
-30
lines changed

2 files changed

+64
-30
lines changed

configure

Lines changed: 57 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,21 +2234,13 @@ AC_ARG_WITH([strict-overflow],
22342234
dnl is defined behaviour via twos-complement.
22352235
dnl Set STRICT_OVERFLOW_CFLAGS and NO_STRICT_OVERFLOW_CFLAGS depending on compiler support.
22362236
dnl Pass the latter to modules that depend on such behaviour.
2237-
_SAVE_VAR([CFLAGS])
2238-
CFLAGS="-fstrict-overflow -fno-strict-overflow"
2239-
AC_CACHE_CHECK([if $CC supports -fstrict-overflow and -fno-strict-overflow],
2240-
[ac_cv_cc_supports_fstrict_overflow],
2241-
AC_COMPILE_IFELSE(
2242-
[AC_LANG_PROGRAM([[]], [[]])],
2243-
[ac_cv_cc_supports_fstrict_overflow=yes],
2244-
[ac_cv_cc_supports_fstrict_overflow=no]
2245-
)
2246-
)
2247-
_RESTORE_VAR([CFLAGS])
2248-
2249-
AS_VAR_IF([ac_cv_cc_supports_fstrict_overflow], [yes],
2250-
[STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
2251-
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
2237+
AX_CHECK_COMPILE_FLAG([-fstrict-overflow],
2238+
[AX_CHECK_COMPILE_FLAG([-fno-strict-overflow],
2239+
[STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
2240+
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
2241+
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fno-strict-overflow])
2242+
STRICT_OVERFLOW_CFLAGS=""
2243+
NO_STRICT_OVERFLOW_CFLAGS=""])],
22522244
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fstrict-overflow])
22532245
STRICT_OVERFLOW_CFLAGS=""
22542246
NO_STRICT_OVERFLOW_CFLAGS=""])

0 commit comments

Comments
 (0)