Skip to content

Commit c2a551a

Browse files
authoredApr 13, 2024··
gh-96398: Detect GCC compatible compilers in configure (#117825)
Introduce a cached variable $ac_cv_gcc_compat and set it to 'yes' if the C preprocessor defines the __GNUC__ macro.
1 parent eca5362 commit c2a551a

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed
 

‎configure

+28-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac

+12
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,18 @@ rm -f conftest.c conftest.out
10251025
# _POSIX_SOURCE, _POSIX_1_SOURCE, and more
10261026
AC_USE_SYSTEM_EXTENSIONS
10271027

1028+
AC_CACHE_CHECK([for GCC compatible compiler],
1029+
[ac_cv_gcc_compat],
1030+
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([
1031+
#if !defined(__GNUC__)
1032+
#error "not GCC compatible"
1033+
#else
1034+
/* GCC compatible! */
1035+
#endif
1036+
], [])],
1037+
[ac_cv_gcc_compat=yes],
1038+
[ac_cv_gcc_compat=no])])
1039+
10281040
AC_SUBST([CXX])
10291041

10301042
preset_cxx="$CXX"

0 commit comments

Comments
 (0)
Please sign in to comment.