[FFmpeg-devel] [PATCH] Fix --extra-cflags (broken in r19411)

Art Clarke aclarke
Mon Jul 20 20:10:11 CEST 2009


In r19411, the --extra-cflags configure flag was broken if/when you passed
in multiple invocations of the flag.  Prior versions of FFmpeg this flag was
additive.  Now, only the last value wins.  To produce the problem, do this:

configure --extra-cflags -I/directory1 --extra-cflags -I/directory2

This patch reverts that change, but I'm sure it doesn't fix whatever the
original committer was trying to fix.  That said, no ffmpeg-devel review was
done of the original patch, and the check-in note for r19411 doesn't say WHY
the checkin was done, so I'll leave it to the author to figure out how to
deal with it.

Or if this is a more correct way to pass multiple flags in onto the C
compiler, I'm all ears (hopefully one that deals with shell quoting).

- Art

-- 
http://www.xuggle.com/
xu?ggle (z?' gl) v. To freely encode, decode, and experience audio and
video.

Use Xuggle to get the power of FFmpeg in Java.
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 19469)
+++ configure	(working copy)
@@ -1360,9 +1360,16 @@
     exit 0
 }
 
+filter_cflags=echo
+filter_cppflags=echo
+filter_asflags=echo
 for opt do
     optval="${opt#*=}"
     case "$opt" in
+    --extra-cflags=*)
+    add_cflags $optval
+    add_asflags $optval
+    ;;
     --extra-ldflags=*) add_ldflags $optval
     ;;
     --extra-libs=*) add_extralibs $optval
@@ -1481,10 +1488,6 @@
     die "Sanity test failed."
 fi
 
-filter_cflags=echo
-filter_cppflags=echo
-filter_asflags=echo
-
 if   $cc --version 2>/dev/null | grep -qi gcc; then
     cc_type=gcc
 elif $cc --version 2>/dev/null | grep -q Intel; then
@@ -1551,9 +1554,6 @@
 : ${ld_default:=$cc}
 set_default as dep_cc ld
 
-add_cflags $extra_cflags
-add_asflags $extra_cflags
-
 if test -n "$sysroot"; then
     case "$cc_type" in
         gcc)



More information about the ffmpeg-devel mailing list