From 4be6702c320f2cf8fb40a135630aa22e91dc56de Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Fri, 25 Mar 2011 00:08:40 +0300 Subject: [PATCH] Improve C99 support checks in configure Fixes configuration with Intel compiler in some cases. --- configure | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index aea03673..e613e90e 100755 --- a/configure +++ b/configure @@ -100,7 +100,11 @@ cc_check() { log_check "for $1" fi elif [ -z "$1" ]; then - log_check "whether $CC supports $3" + if [ -z "$2" ]; then + log_check "whether $CC supports $3" + else + log_check "whether $CC supports $3 with $2" + fi else log_check "for $3 in $1"; fi @@ -558,10 +562,12 @@ log_msg "" cc_check || die "No working C compiler found." if [ $compiler != ICL ]; then - if cc_check '' -std=gnu99 ; then + if cc_check '' -std=gnu99 'for( int i = 0; i < 9; i++ );' ; then CFLAGS="$CFLAGS -std=gnu99" - elif cc_check '' -std=c99 ; then + elif cc_check '' -std=c99 'for( int i = 0; i < 9; i++ );' ; then CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE" + elif ! cc_check '' '' 'for( int i = 0; i < 9; i++ );' ; then + die "C99 compiler is needed for compilation." fi fi -- 2.47.3