[FFmpeg-devel] [PATCH] configure: remove -std= from c++ compilation

Rick Kern kernrj at gmail.com
Mon Jun 27 01:08:06 CEST 2016


Pulling -std=c99 into CXXFLAGS from CFLAGS causes a compile error with c++
files using clang on OS X.
Adding -std=c++98 unconditionally to CXXFLAGS will generate a compile error
on compilers that don't support the -std option.
It works but is less readable if -std=c++98 is appended after -std=c99 when
the -std option is supported.

Signed-off-by: Rick Kern <kernrj at gmail.com>
---
 common.mak | 2 +-
 configure  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/common.mak b/common.mak
index 3f2096d..c4ab049 100644
--- a/common.mak
+++ b/common.mak
@@ -39,7 +39,7 @@ CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
 OBJCFLAGS  += $(EOBJCFLAGS)
 OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
 ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
-CXXFLAGS   := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
+CXXFLAGS   := $(CPPFLAGS) $(patsubst -std=%,,$(CFLAGS)) $(CXXFLAGS)
 YASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
 
 HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
diff --git a/configure b/configure
index 76d2d27..901df6c 100755
--- a/configure
+++ b/configure
@@ -4529,7 +4529,6 @@ fi
 
 add_cppflags -D_ISOC99_SOURCE
 add_cxxflags -D__STDC_CONSTANT_MACROS
-add_cxxflags -std=c++98
 check_cflags -std=c99
 check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
 #include <stdlib.h>
-- 
2.9.0



More information about the ffmpeg-devel mailing list