diff options
author | konablend <[email protected]> | 2009-04-14 20:10:57 +0000 |
---|---|---|
committer | konablend <[email protected]> | 2009-04-14 20:10:57 +0000 |
commit | 16b2cd579e17d46bdf7bcec3059a92d2c80d21e8 (patch) | |
tree | f23def4a82677bda7b031b1e2f56c249e6c93d9e /make/include | |
parent | 6a59b3ba40c2d2bbe977684d31b345bdd3a5ef93 (diff) |
This patch adds mingw32 cross-compilation support to HandBrake trunk to
produce native win32 binaries. The main benefits are the binary does not have
any Cygwin runtime requirements and various host platforms can be leveraged
to build HandBrake.
Cross-compilation toolchains are complex to setup and recommended for experts
only; but once setup it can build at speeds similar to native builds,
on Darwin or Linux.
BUILD INSTRUCTIONS:
Add mingw32 toolchain to beginning of your path and take the toolchain
prefix from gcc (eg: i386-mingw32-gcc) and pass to configure:
./configure --cross=i386-ming32
PRODUCTS:
- hb.lib (static library)
- HandBrakeCLI.exe
DOWNLOADS:
Contrib downloads need to be seeded with:
- pthreads-w32-2-8-0-release.tar.gz (new)
- xvidcore-20090311.tar.gz
SUMMARY:
Specifically, all GUI trees are not impacted.
configure
- added --cross=PREFIX
- reworked search for gcc and cross-compile related tools to use prefix
contrib/
- sub-patches added as needed for mingw
contrib/xvidcore/
- bumped from 1.1.3 -> 1.2.1+ (daily 20090311)
- reconstituted P01-cygwin.patch
- created new P00-darwin.patch needed for macho64 asm flag on x86_64 arch
libhb/
- uint -> uint32_t
- remaining changes guarded by mingw32 macro.
test/
- modified to support pthread-compatibility library attach/detach.
- all changes guarded by mingw32 macro.
BRANCHES:
source: https://hbfork.googlecode.com/svn/branches/mingw@28
target: svn://svn.handbrake.fr/HandBrake/trunk@2325
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2326 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'make/include')
-rw-r--r-- | make/include/contrib.defs | 6 | ||||
-rw-r--r-- | make/include/gcc.defs | 60 | ||||
-rw-r--r-- | make/include/main.defs | 35 | ||||
-rw-r--r-- | make/include/main.rules | 4 |
4 files changed, 73 insertions, 32 deletions
diff --git a/make/include/contrib.defs b/make/include/contrib.defs index cbc70866b..a3019ade7 100644 --- a/make/include/contrib.defs +++ b/make/include/contrib.defs @@ -83,10 +83,10 @@ define import.CONTRIB.defs $(1).CONFIGURE.args = !sete @dir !bootstrap !env !exe @host @prefix !deps !shared !static !extra $(1).CONFIGURE.env.CC = CC=$$($(1).GCC.gcc) - $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs)" + $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs ?extra)" $(1).CONFIGURE.env.CXX = CXX=$$($(1).GCC.gxx) - $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs)" - $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="$$(call fn.ARGS,$(1).GCC,*archs)" + $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs ?extra)" + $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="$$(call fn.ARGS,$(1).GCC,*archs ?extra)" $(1).CONFIGURE.env.LDFLAGS = LDFLAGS="$$(call fn.ARGS,$(1).GCC,*archs)" $(1).CONFIGURE.env.args = !CC !CFLAGS !CXX !CXXFLAGS !CPPFLAGS !LDFLAGS diff --git a/make/include/gcc.defs b/make/include/gcc.defs index 35a6e50a8..f9511d1b5 100644 --- a/make/include/gcc.defs +++ b/make/include/gcc.defs @@ -12,7 +12,6 @@ GCC.vis = 0 GCC.pic = 0 GCC.g = none GCC.O = none -GCC.extra = 1 GCC.D = GCC.I = GCC.muldefs = 0 @@ -24,6 +23,16 @@ GCC.L = GCC.l = GCC.end = 0 +GCC.extra = 1 +GCC.extra.h_o = 1 +GCC.extra.c_o = 1 +GCC.extra.dylib = 1 +GCC.extra.exe = 1 +GCC.extra.hpp_o = 1 +GCC.extra.cpp_o = 1 +GCC.extra.dylib++ = 1 +GCC.extra.exe++ = 1 + GCC.args.pipe = -pipe GCC.args.strip = -Wl,-S GCC.args.dylib = -dynamiclib @@ -40,7 +49,6 @@ 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 @@ -51,6 +59,16 @@ GCC.args.L = -L$(1) GCC.args.l = -l$(1) GCC.args.end = -Wl,--end-group +GCC.args.extra = +GCC.args.extra.h_o = +GCC.args.extra.c_o = +GCC.args.extra.dylib = +GCC.args.extra.exe = +GCC.args.extra.hpp_o = +GCC.args.extra.cpp_o = +GCC.args.extra.dylib++ = +GCC.args.extra.exe++ = + ############################################################################### define import.GCC @@ -68,7 +86,6 @@ 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) @@ -80,6 +97,16 @@ define import.GCC $(1).GCC.l = $$(GCC.l) $(1).GCC.end = $$(GCC.end) + $(1).GCC.extra = $$(GCC.extra) + $(1).GCC.extra.h_o = $$(GCC.extra.h_o) + $(1).GCC.extra.c_o = $$(GCC.extra.c_o) + $(1).GCC.extra.dylib = $$(GCC.extra.dylib) + $(1).GCC.extra.exe = $$(GCC.extra.exe) + $(1).GCC.extra.hpp_o = $$(GCC.extra.hpp_o) + $(1).GCC.extra.cpp_o = $$(GCC.extra.cpp_o) + $(1).GCC.extra.dylib++ = $$(GCC.extra.dylib++) + $(1).GCC.extra.exe++ = $$(GCC.extra.exe++) + $(1).GCC.args.pipe = $$(GCC.args.pipe) $(1).GCC.args.strip = $$(GCC.args.strip) $(1).GCC.args.dylib = $$(GCC.args.dylib) @@ -96,7 +123,6 @@ 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) @@ -107,25 +133,35 @@ define import.GCC $(1).GCC.args.l = $$(GCC.args.l) $(1).GCC.args.end = $$(GCC.args.end) + $(1).GCC.args.extra = $$(GCC.args.extra) + $(1).GCC.args.extra.h_o = $$(GCC.args.extra.h_o) + $(1).GCC.args.extra.c_o = $$(GCC.args.extra.c_o) + $(1).GCC.args.extra.dylib = $$(GCC.args.extra.dylib) + $(1).GCC.args.extra.exe = $$(GCC.args.extra.exe) + $(1).GCC.args.extra.hpp_o = $$(GCC.args.extra.hpp_o) + $(1).GCC.args.extra.cpp_o = $$(GCC.args.extra.cpp_o) + $(1).GCC.args.extra.dylib++ = $$(GCC.args.extra.dylib++) + $(1).GCC.args.extra.exe++ = $$(GCC.args.extra.exe++) + ########################################################################### $(1).GCC.c = -c $$(4) $(1).GCC.o = -o $$(3) # FUNCTION: C precompiled headers - $(1).GCC.H_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra *D *I !c !o + $(1).GCC.H_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra ?extra.h_o *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 ?extra *D *I !c !o + $(1).GCC.C_O.args = !gcc ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra ?extra.c_o *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 ?extra *D *I !c !o + $(1).GCC.HPP_O.args = !gxx ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra ?extra.hpp_o *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 ?extra *D *I !c !o + $(1).GCC.CPP_O.args = !gxx ?pipe ?ML ?H *W *archs ?vis ?pic .g .O ?extra ?extra.cpp_o *D *I !c !o $(1).GCC.CPP_O = $$(call fn.ARGS,$(1).GCC,$$($(1).GCC.CPP_O.args),$$(1),$$(2)) ########################################################################### @@ -133,18 +169,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 ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.DYLIB.args = !gcc ?pipe ?strip ?dylib ?extra.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 ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.EXE.args = !gcc ?pipe ?strip ?extra.exe ?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 ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.DYLIB++.args = !gxx ?pipe ?strip ?dylib ?extra.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 ?extra *D *I !o ?muldefs ?start !i *F *f *L *l *i !a ?end + $(1).GCC.EXE++.args = !gxx ?pipe ?strip ?extra.exe++ ?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 diff --git a/make/include/main.defs b/make/include/main.defs index f07678b79..a1bafbb92 100644 --- a/make/include/main.defs +++ b/make/include/main.defs @@ -10,7 +10,7 @@ include $(SRC/)make/include/tool.defs MODULES += contrib/a52dec -ifneq (,$(filter $(BUILD.system),cygwin)) +ifneq (,$(filter $(BUILD.system),cygwin mingw)) MODULES += contrib/bzip2 endif @@ -27,10 +27,15 @@ MODULES += contrib/libsamplerate MODULES += contrib/libtheora MODULES += contrib/libvorbis MODULES += contrib/mpeg2dec + +ifneq (,$(filter $(BUILD.system),mingw)) + MODULES += contrib/pthreadw32 +endif + MODULES += contrib/x264 MODULES += contrib/xvidcore -ifneq (,$(filter $(BUILD.system),cygwin)) +ifneq (,$(filter $(BUILD.system),cygwin mingw)) MODULES += contrib/zlib endif @@ -39,21 +44,21 @@ MODULES += libhb ############################################################################### -## test module is replaced with macosx when Darwin+Xcode -ifneq (,$(filter $(BUILD.system),darwin)) - ifeq (1,$(FEATURE.xcode)) - MODULES += macosx - else - MODULES += test - endif +ifeq (1-darwin,$(FEATURE.xcode)-$(BUILD.system)) + ## use macosx module when xcode+darwin + MODULES += macosx else + ## default is to build CLI MODULES += test endif -ifneq (,$(filter $(BUILD.system),linux)) - ifeq (1,$(FEATURE.gtk)) - MODULES += gtk - endif +ifeq (1-mingw,$(FEATURE.gtk.mingw)-$(BUILD.system)) + MODULES += gtk +endif + +ifeq (1-linux,$(FEATURE.gtk)-$(BUILD.system)) + ## build gtk when gtk+linux + MODULES += gtk endif ############################################################################### @@ -63,5 +68,5 @@ MODULES += doc ############################################################################### include $(MODULES:%=$(SRC/)%/module.defs) -include $(SRC/)make/variant/$(HOST.system).defs --include $(SRC/)make/variant/$(HOST.system).$(BUILD.machine).defs +include $(SRC/)make/variant/$(BUILD.system).defs +-include $(SRC/)make/variant/$(BUILD.system).$(BUILD.machine).defs diff --git a/make/include/main.rules b/make/include/main.rules index d1a16212a..2b288ab31 100644 --- a/make/include/main.rules +++ b/make/include/main.rules @@ -33,8 +33,8 @@ mrproper: xclean include $(SRC/)make/include/base.rules include $(MODULES:%=$(SRC/)%/module.rules) --include $(SRC/)make/variant/$(HOST.system).rules --include $(SRC/)make/variant/$(HOST.system).$(BUILD.machine).rules +-include $(SRC/)make/variant/$(BUILD.system).rules +-include $(SRC/)make/variant/$(BUILD.system).$(BUILD.machine).rules ############################################################################### |