From 5998ad3ae85b0f4e9f2b94917bc395f56ff891b2 Mon Sep 17 00:00:00 2001 From: Ruben Laguna Date: Wed, 28 Jan 2015 22:22:23 +0100 Subject: [PATCH] C11 checks --- configure.ac | 15 ++++++++++++++- src/Makefile.am | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a63f6e7..6f9fe9d 100644 --- a/configure.ac +++ b/configure.ac @@ -7,14 +7,27 @@ AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_HEADERS([config.h]) +AC_LANG([C]) # Use C not C++ + # Checks for programs. AC_PROG_CC + +# In case that you want to check for specific versions of gcc +# For example in case that you need C11 support you want to +# check for gcc-4.9 +#AC_PROG_CC([gcc-4.9 gcc cc]) + AC_PROG_INSTALL # Checks for libraries. # Checks for header files. -AC_CHECK_HEADERS([stdlib.h]) +AC_CHECK_HEADER([stdlib.h]) + +# Check for C11's optional Atomic operations library +# AC_CHECK_HEADER([stdatomic.h], [], [ +# AC_MSG_ERROR([C11 with atomic support needed.]) +# ]) # Checks for typedefs, structures, and compiler characteristics. diff --git a/src/Makefile.am b/src/Makefile.am index b702a43..1a26f52 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,2 +1,3 @@ bin_PROGRAMS = myexecutable myexecutable_SOURCES = main.c +myexecutable_CFLAGS = #--std=c11 # CFLAGS applicable to myexecutable_SOURCES