[pulseaudio-discuss] [PATCH v3 14/24] build-sys: Move to compiling with C11 support

Arun Raghavan arun at accosted.net
Wed Feb 3 20:52:29 PST 2016


On Thu, 2016-02-04 at 06:04 +0200, Tanu Kaskinen wrote:
> On Mon, 2016-01-18 at 13:06 +0530, arun at accosted.net wrote:
> > @@ -176,6 +175,8 @@ esac
> >  
> >  #### Compiler flags ####
> >  
> > +AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS="$CFLAGS -std=c11"], [],
> > [-pedantic -Werror])
> 
> This does nothing if the compile flag isn't supported. Shouldn't we
> fail in configure if -std=c11 doesn't work?

Right, I'm rewriting this line as:

AX_CHECK_COMPILE_FLAG([-std=c11],
   [CFLAGS="$CFLAGS -std=c11"],
   [AC_MSG_ERROR([*** Compiler does not support -std=c11])],
   [-pedantic -Werror])

> Also, I don't think we should set CFLAGS. Adding -std=c11 to
> AM_CFLAGS
> in src/Makefile.am seems like the right thing to do. See
> https://www.gnu.org/software/automake/manual/html_node/User-Variables
> .html#User-Variables

This would make it inconsistent with the rest of configure.ac, though.
It'd be nice to change everything to use AM_CFLAGS but that should be a
separate change.

One more thing that's missing in this change is an addition
of ax_check_compile_flag.m4. I'll squash that in too.

-- Arun


More information about the pulseaudio-discuss mailing list