From: Anton Mitrofanov Date: Thu, 24 Mar 2011 21:08:40 +0000 (+0300) Subject: Improve C99 support checks in configure X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=4be6702c320f2cf8fb40a135630aa22e91dc56de;p=x264.git Improve C99 support checks in configure Fixes configuration with Intel compiler in some cases. --- 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