From c54c2b606fe70d262a43f4d11b46aa184cfd7577 Mon Sep 17 00:00:00 2001 From: Chen Jie Date: Sat, 15 Jun 2013 14:14:58 +0800 Subject: [PATCH] gst-ffmpeg*.recipe: passing cflags/ldflags to embeded ffmpeg/libav --- recipes/gst-ffmpeg-static.recipe | 25 +++++++++++++++---------- recipes/gst-ffmpeg.recipe | 12 +++++++++--- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/recipes/gst-ffmpeg-static.recipe b/recipes/gst-ffmpeg-static.recipe index fa32047..634f0ab 100644 --- a/recipes/gst-ffmpeg-static.recipe +++ b/recipes/gst-ffmpeg-static.recipe @@ -18,10 +18,6 @@ class Recipe(custom.GStreamerStatic): files_plugins_codecs_restricted_devel = ['libgstffmpeg'] def prepare(self): - if self.config.target_platform == Platform.WINDOWS: - self.configure_options += \ - '--with-ffmpeg-extra-configure="--enable-w32threads"' - if self.config.target_platform == Platform.DARWIN: if self.config.target_arch == Architecture.X86_64: asflags = ' -arch x86_64 -m64' @@ -37,20 +33,29 @@ class Recipe(custom.GStreamerStatic): self.files_plugins_codecs_restricted_devel.append(path) def configure(self): - opts = None + opts = '' + ffmpeg_cflags = '$CFLAGS' + ffmpeg_ldflags = '$LDFLAGS' + if self.config.target_platform == Platform.ANDROID: if self.config.target_arch == Architecture.X86: - opts = '--extra-cflags=-mincoming-stack-boundary=4' - if self.config.target_platform == Platform.WINDOWS: - opts = '--cross-prefix=%s- --target-os=mingw32 --arch=%s' %\ + ffmpeg_cflags += ' -mincoming-stack-boundary=4' + elif self.config.target_arch == Architecture.ARMv7: + #ffmpeg_cflags += ' -mfpu=neon' #Enable neon + pass + elif self.config.target_platform == Platform.WINDOWS: + opts = '--enable-w32threads --cross-prefix=%s- --target-os=mingw32 --arch=%s' %\ (self.config.host, self.config.target_arch) - if self.config.target_platform == Platform.IOS: + elif self.config.target_platform == Platform.IOS: opts = "--enable-cross-compile --target-os=darwin --cross-prefix='' --arch=%s "\ - "--cc='$CC' --ar='$AR' --nm='$NM' --extra-cflags='$CFLAGS'" % self.config.target_arch + "--cc='$CC' --ar='$AR' --nm='$NM'" % self.config.target_arch if self.config.target_arch == Architecture.X86: opts += ' --as=$AS' else: opts += " --as='$GAS'" + + opts += ' --extra-cflags=\\"%s\\" --extra-ldflags=\\"%s\\"' %\ + (ffmpeg_cflags, ffmpeg_ldflags) if opts: opts_file = os.path.join(self.build_dir, 'ffmpeg_extra_configure_options') with open(opts_file, 'w+') as f: diff --git a/recipes/gst-ffmpeg.recipe b/recipes/gst-ffmpeg.recipe index 562d193..62d345f 100644 --- a/recipes/gst-ffmpeg.recipe +++ b/recipes/gst-ffmpeg.recipe @@ -27,20 +27,26 @@ class Recipe(recipe.Recipe): self.configure_options += ' ASFLAGS="%s"' % asflags def configure(self): - opts = None + opts = '' + ffmpeg_cflags = '$CFLAGS' + ffmpeg_ldflags = '$LDFLAGS' + if self.config.target_platform == Platform.WINDOWS: opts = '--cross-prefix=%s- --target-os=mingw32 --arch=%s --enable-w32threads' %\ (self.config.host, self.config.target_arch) if self.config.target_platform == Platform.ANDROID: if self.config.target_arch == Architecture.X86: - opts = '--extra-cflags=-mincoming-stack-boundary=4' + ffmpeg_cflags += ' -mincoming-stack-boundary=4' if self.config.target_platform == Platform.IOS: opts = "--enable-cross-compile --target-os=darwin --cross-prefix='' --arch=%s "\ - "--cc='$CC' --ar='$AR' --nm='$NM' --extra-cflags='$CFLAGS'" % self.config.target_arch + "--cc='$CC' --ar='$AR' --nm='$NM'" % self.config.target_arch if self.config.target_arch == Architecture.X86: opts += ' --as=$AS' else: opts += " --as='$GAS'" + + opts += ' --extra-cflags=\\"%s\\" --extra-ldflags=\\"%s\\"' %\ + (ffmpeg_cflags, ffmpeg_ldflags) if opts: opts_file = os.path.join(self.build_dir, 'ffmpeg_extra_configure_options') with open(opts_file, 'w+') as f: -- 1.8.1.4