Use the AC_PROG_CC_C99 macro in configure.ac to ensure that the
compiler can handle C99 features by putting it in C99 mode (e.g., by
using the -std=gnu99 argument to gcc).  If the compiler doesn't
support C99, exit with an error.

(We currently use some C99 features like inline functions,
intermingled declarations and code, long long int, compound literals,
variable-length arrays, // comments, snprintf(), variadic macros, etc.
Eventually we will want to use the restrict keyword.)

Note that even though AC_PROG_CC_C99 automatically calls AC_PROG_CC,
the existing call to AC_PROG_CC is left in place because the Autoconf
documentation does not say that AC_PROG_CC_C99 calls AC_PROG_CC.  (The
documentation does say that it is safe to expand AC_PROG_CC multiple
times, however.)
---
 configure.ac | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 80adbb6..64bc186 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,9 @@ AM_MAINTAINER_MODE
 : ${CFLAGS=""}
 # Checks for programs.
 AC_PROG_CC
+AC_PROG_CC_C99
+AS_IF([test "x${ac_cv_prog_cc_c99}" = xno],
+      [AC_MSG_ERROR([C99 compiler is required])])
 AC_PROG_RANLIB
 AC_PROG_SED
 AM_PATH_PYTHON([$MIN_PYTHON_VERSION])
-- 
2.4.5


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
rpstir-devel mailing list
rpstir-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpstir-devel

Reply via email to