[x264-devel] Improve C99 support checks in configure

Anton Mitrofanov git at videolan.org
Wed Apr 13 04:04:27 CEST 2011


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Fri Mar 25 00:08:40 2011 +0300| [4be6702c320f2cf8fb40a135630aa22e91dc56de] | committer: Jason Garrett-Glaser

Improve C99 support checks in configure
Fixes configuration with Intel compiler in some cases.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=4be6702c320f2cf8fb40a135630aa22e91dc56de
---

 configure |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index aea0367..e613e90 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
 



More information about the x264-devel mailing list