Skip to content

Commit

Permalink
pythongh-96398: Detect GCC compatible compilers in configure
Browse files Browse the repository at this point in the history
Introduce a cached variable $ac_cv_gcc_compat and set it to 'yes' if
the C preprocessor defines the __GNUC__ macro.
  • Loading branch information
erlend-aasland committed Apr 12, 2024
1 parent 444b92d commit 1077ec3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
29 changes: 28 additions & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,18 @@ rm -f conftest.c conftest.out
# _POSIX_SOURCE, _POSIX_1_SOURCE, and more
AC_USE_SYSTEM_EXTENSIONS

AC_CACHE_CHECK([for GCC compatible compiler],
[ac_cv_gcc_compat],
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#if !defined(__GNUC__)
#error "not GCC compatible"
#else
/* GCC compatible! */
#endif
], [])],
[ac_cv_gcc_compat=yes],
[ac_cv_gcc_compat=no])])

AC_SUBST([CXX])

preset_cxx="$CXX"
Expand Down

0 comments on commit 1077ec3

Please sign in to comment.