Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gh-96398: Detect GCC compatible compilers in configure
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
commit 1077ec316c9cf8fc9032f72fc8c317239073c203
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