Skip to content
Open
Changes from all commits
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
14 changes: 13 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,21 @@ AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])

AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC_C99
dnl
dnl Check that compiler supports C11 or newer standard
dnl
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
# error C11 or newer required
#endif
]])],
[],
[AC_MSG_ERROR([C11 or newer compiler required (GCC >= 4.9, Clang >= 3.3)])]
)
Comment on lines +50 to +61

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_PROG_CC_C99 checks and sets -std flag to use C99 version. So we should reproduce that functionality, this code snippet just checks the default version of C used, doesn't actually probe if the compiler is capable of using C11 standard, and also doesn't set the required flag. I'm aware the flag AC_PROG_CC_C11 exists but this breaks compilation on certain systems. Another approach for actually probing capability and setting the flag should be used.

AM_PROG_CC_C_O
AM_PROG_AR
dnl
Expand Down