diff --git a/configure.ac b/configure.ac index 72a134d..2c07a30 100644 --- a/configure.ac +++ b/configure.ac @@ -65,7 +65,18 @@ # Checks for programs. AC_PROG_CC -AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=" -std=c11"], [AC_PROG_CC_C99]) +AC_ARG_ENABLE([c11], + [AS_HELP_STRING([--enable-c11], + [enable C11 for C compiler [default=no]])], + [zmq_enable_c11=$enableval], + [zmq_enable_c11="no"]) +if test "x$zmq_enable_c11" != "xno"; then + AX_CHECK_COMPILE_FLAG([-std=gnu11], + [CFLAGS+=" -std=gnu11"], + [AC_MSG_ERROR([C11 requested but not supported by the compiler.])]) +else + AC_PROG_CC_C99 +fi AC_PROG_CXX AX_CODE_COVERAGE AM_PROG_CC_C_O