espeak-ng requires a C11 compiler, so document and check this

This commit is contained in:
Reece H. Dunn
2015-12-10 19:42:27 +00:00
parent 3ca931f55f
commit ca5f651d1d
2 changed files with 50 additions and 4 deletions
+3 -2
View File
@@ -30,8 +30,9 @@ In order to build eSpeak NG, you need:
1. a functional autotools system (`make`, `autoconf`, `automake`, `libtool`
and `pkg-config`);
2. a functional c++ compiler;
3. wxWidgets development libraries (needed to build and run espeakedit
2. a functional c compiler that supports C11;
3. a functional c++ compiler;
4. wxWidgets development libraries (needed to build and run espeakedit
to compile the phoneme data).
Optionally, you need:
+47 -2
View File
@@ -18,6 +18,48 @@ AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
dnl ================================================================
dnl C11 compiler checks.
dnl ================================================================
AC_LANG_PUSH(C)
AC_MSG_CHECKING([if $CC supports C11 without any flags])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[// test]],
[[]])],
[AC_MSG_RESULT([yes])
have_c11_native=yes],
[AC_MSG_RESULT([no])
have_c11_native=no])
AC_LANG_POP(C)
AC_LANG_PUSH(C)
TEMP_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std=c11"
AC_MSG_CHECKING([if $CC supports C11 with the -std=c11 flag])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[// test]],
[[]])],
[AC_MSG_RESULT([yes])
have_c11_c11=yes],
[AC_MSG_RESULT([no])
have_c11_c11=no])
CFLAGS="$TEMP_CFLAGS"
AC_LANG_POP(C)
AC_MSG_CHECKING([if $CC supports C11])
if test "$have_c11_c11" = yes ; then
AC_MSG_RESULT([-std=c11])
CFLAGS="$CFLAGS -std=c11"
elif test "$have_c11_native" = yes ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([C11 is not supported by $CC.])
fi
dnl ================================================================
dnl getopt checks.
dnl ================================================================
@@ -248,8 +290,11 @@ AC_MSG_NOTICE([
Source code location: ${srcdir}
Compiler: ${CXX}
Compiler flags: ${CXXFLAGS}
C11 Compiler: ${CC}
C11 Compiler flags: ${CFLAGS}
C++ Compiler: ${CXX}
C++ Compiler flags: ${CXXFLAGS}
wxWidgets: ${WX_VERSION} (${WX_CONFIG})
pulseaudio: ${have_pulseaudio}