From e4696d0160d9ca0493979dd232d05ad5db293f95 Mon Sep 17 00:00:00 2001 From: konablend Date: Tue, 10 Mar 2009 22:43:11 +0000 Subject: [PATCH] Cygwin: ffmpeg build tweaks - bug: issues with universal input (including aac in mp4, wmv etc) - fix: add -fno-common to GCC - correctness: add --enable-memalign-hack as per ffmpeg docs - these issues were possibly a regression introduced with the new build system - a positive side effect to the build system is the availability of new makevar '.GCC.args.extra' which is a free-form way to add extra cflags to GCC functions. [this changeset does not effect any other platforms] git-svn-id: svn://localhost/HandBrake/trunk@2252 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- contrib/ffmpeg/module.defs | 9 +++++++-- make/include/gcc.defs | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs index f045ad5b..8c6c9d1e 100644 --- a/contrib/ffmpeg/module.defs +++ b/contrib/ffmpeg/module.defs @@ -24,9 +24,14 @@ FFMPEG.CONFIGURE.extra = \ --enable-pthreads \ --enable-swscale \ --cc="$(GCC.gcc)" \ - --extra-cflags="$(call fn.ARGS,FFMPEG.GCC,*archs) -I$(call fn.ABSOLUTE,$(CONTRIB.build/)include)" \ - --extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)" + --extra-cflags="$(call fn.ARGS,FFMPEG.GCC,*archs ?extra) -I$(call fn.ABSOLUTE,$(CONTRIB.build/)include)" \ + --extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)" ifeq ($(BUILD.cross),1) FFMPEG.CONFIGURE.extra += --enable-cross-compile --arch=$(BUILD.machine) endif + +ifeq (cygwin,$(BUILD.system)) + FFMPEG.CONFIGURE.extra += --enable-memalign-hack + FFMPEG.GCC.args.extra = -fno-common +endif diff --git a/make/include/gcc.defs b/make/include/gcc.defs index ef4b180f..35a6e50a 100644 --- a/make/include/gcc.defs +++ b/make/include/gcc.defs @@ -12,6 +12,7 @@ GCC.vis = 0 GCC.pic = 0 GCC.g = none GCC.O = none +GCC.extra = 1 GCC.D = GCC.I = GCC.muldefs = 0 @@ -39,6 +40,7 @@ GCC.args.g.max = -gdwarf-2 -g3 GCC.args.O.none = -O0 GCC.args.O.size = -Os GCC.args.O.speed = -O3 +GCC.args.extra = GCC.args.D = -D$(1) GCC.args.I = -I$(1) GCC.args.muldefs = -Wl,--allow-multiple-definition @@ -66,6 +68,7 @@ define import.GCC $(1).GCC.pic = $$(GCC.pic) $(1).GCC.g = $$(GCC.g) $(1).GCC.O = $$(GCC.O) + $(1).GCC.extra = $$(GCC.extra) $(1).GCC.D = $$(GCC.D) $(1).GCC.I = $$(GCC.I) $(1).GCC.muldefs = $$(GCC.muldefs) @@ -93,6 +96,7 @@ define import.GCC $(1).GCC.args.O.none = $$(GCC.args.O.none) $(1).GCC.args.O.size = $$(GCC.args.O.size) $(1).GCC.args.O.speed = $$(GCC.args.O.speed) + $(1).GCC.args.extra = $$(GCC.args.extra) $(1).GCC.args.D = $$(GCC.args.D) $(1).GCC.args.I = $$(GCC.args.I) $(1).GCC.args.muldefs = $$(GCC.args.muldefs) @@ -109,19 +113,19 @@ define import.GCC $(1).GCC.o = -o $$(3) # FUNCTION: C precompiled headers - $(1).GCC.H_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O *D *I !c !o + $(1).GCC.H_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra *D *I !c !o $(1).GCC.H_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.H_O.args),$$(1),$$(2)) # FUNCTION: C compile source - $(1).GCC.C_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O *D *I !c !o + $(1).GCC.C_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra *D *I !c !o $(1).GCC.C_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.C_O.args),$$(1),$$(2)) # FUNCTION: C++ precompile headers - $(1).GCC.HPP_O.args = !gxx ?pipe ?ML ?H *W *archs ?vis ?pic .g .O *D *I !c !o + $(1).GCC.HPP_O.args = !gxx ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra *D *I !c !o $(1).GCC.HPP_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.HPP_O.args),$$(1),$$(2)) # FUNCTION: C++ compile source - $(1).GCC.CPP_O.args = !gxx ?pipe ?ML ?H *W *archs ?vis ?pic .g .O *D *I !c !o + $(1).GCC.CPP_O.args = !gxx ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra *D *I !c !o $(1).GCC.CPP_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.CPP_O.args),$$(1),$$(2)) ########################################################################### @@ -129,18 +133,18 @@ define import.GCC $(1).GCC.i = $$(4) # FUNCTION: C link dynamic-lib - $(1).GCC.DYLIB.args = !gcc ?pipe ?strip ?dylib ?ML *W *archs ?vis ?pic .g .O *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.DYLIB.args = !gcc ?pipe ?strip ?dylib ?ML *W *archs ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end $(1).GCC.DYLIB = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.DYLIB.args),$$(1),$$(2)) # FUNCTION: C link executable - $(1).GCC.EXE.args = !gcc ?pipe ?strip ?ML *W *archs ?vis ?pic .g .O *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.EXE.args = !gcc ?pipe ?strip ?ML *W *archs ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end $(1).GCC.EXE = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.EXE.args),$$(1),$$(2)) # FUNCTION: C++ link dynamic-lib - $(1).GCC.DYLIB++.args = !gxx ?pipe ?strip ?dylib ?ML *W *archs ?vis ?pic .g .O *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.DYLIB++.args = !gxx ?pipe ?strip ?dylib ?ML *W *archs ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end $(1).GCC.DYLIB++ = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.DYLIB++.args),$$(1),$$(2)) # FUNCTION: C++ link executable - $(1).GCC.EXE++.args = !gxx ?pipe ?strip ?ML *W *archs ?vis ?pic .g .O *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.EXE++.args = !gxx ?pipe ?strip ?ML *W *archs ?vis ?pic .g .O ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end $(1).GCC.EXE++ = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.EXE++.args),$$(1),$$(2)) endef -- 2.11.0