summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-09-04 21:22:41 +0000
committerjstebbins <[email protected]>2009-09-04 21:22:41 +0000
commit74302fd6044b633bcd683bb8e6a0faa39d113732 (patch)
tree7413aab00083d7761723884a5733cfb2b2d98733 /make
parentb65acba4026ec467b8b699612033db005471862f (diff)
build system: add capability to build Leopard target from Snow Leopard Host
To configure for building Leopard target from Snow Leopard: configure --sysroot /Developer/SDKs/MacOSX10.5.sdk --minver 10.5 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2806 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'make')
-rw-r--r--make/configure.py21
-rw-r--r--make/include/contrib.defs8
-rw-r--r--make/include/gcc.defs32
3 files changed, 49 insertions, 12 deletions
diff --git a/make/configure.py b/make/configure.py
index 4b98b9bf3..9580bfbb1 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -199,6 +199,15 @@ class Configure( object ):
self.src_dir = os.path.normpath( options.src )
self.build_dir = os.path.normpath( options.build )
self.prefix_dir = os.path.normpath( options.prefix )
+ if options.sysroot != None:
+ self.sysroot_dir = os.path.normpath( options.sysroot )
+ else:
+ self.sysroot_dir = ""
+
+ if options.minver != None:
+ self.minver = options.minver
+ else:
+ self.minver = ""
## special case if src == build: add build subdir
if os.path.abspath( self.src_dir ) == os.path.abspath( self.build_dir ):
@@ -943,6 +952,9 @@ def createCLI():
## add install options
grp = OptionGroup( cli, 'Directory Locations' )
+ h = IfHost( 'specify sysroot (e.g. for Leopard builds from Snow Leapard)', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
+ grp.add_option( '--sysroot', default=None, action='store', metavar='DIR',
+ help=h )
grp.add_option( '--src', default=cfg.src_dir, action='store', metavar='DIR',
help='specify top-level source dir [%s]' % (cfg.src_dir) )
grp.add_option( '--build', default=cfg.build_dir, action='store', metavar='DIR',
@@ -986,6 +998,9 @@ def createCLI():
arch.mode.cli_add_option( grp, '--arch' )
grp.add_option( '--cross', default=None, action='store', metavar='SPEC',
help='specify GCC cross-compilation spec' )
+ h = IfHost( 'Min OS X Version', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
+ grp.add_option( '--minver', default=None, action='store', metavar='VER',
+ help=h )
cli.add_option_group( grp )
## add tool locations
@@ -1301,8 +1316,14 @@ try:
doc.addBlank()
if build.match( '*-*-darwin*' ):
doc.add( 'GCC.archs', arch.mode.mode )
+ doc.add( 'GCC.sysroot', cfg.sysroot_dir )
+ doc.add( 'GCC.minver', cfg.minver )
else:
doc.add( 'GCC.archs', '' )
+ doc.add( 'GCC.sysroot', '' )
+ doc.add( 'GCC.minver', '' )
+ doc.add( 'GCC.ldsysroot', '$(GCC.sysroot)' )
+ doc.add( 'GCC.ldminver', '$(GCC.minver)' )
doc.add( 'GCC.g', debugMode.mode )
doc.add( 'GCC.O', optimizeMode.mode )
diff --git a/make/include/contrib.defs b/make/include/contrib.defs
index 2b7d6223c..fcff27356 100644
--- a/make/include/contrib.defs
+++ b/make/include/contrib.defs
@@ -83,11 +83,11 @@ 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 ?extra)"
+ $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
$(1).CONFIGURE.env.CXX = CXX=$$($(1).GCC.gxx)
- $(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.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
+ $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)"
+ $(1).CONFIGURE.env.LDFLAGS = LDFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver)"
$(1).CONFIGURE.env.args = !CC !CFLAGS !CXX !CXXFLAGS !CPPFLAGS !LDFLAGS
$(1).CONFIGURE.env = $$(call fn.ARGS,$(1).CONFIGURE.env,$$($(1).CONFIGURE.env.args))
diff --git a/make/include/gcc.defs b/make/include/gcc.defs
index f9511d1b5..a9523ddde 100644
--- a/make/include/gcc.defs
+++ b/make/include/gcc.defs
@@ -8,6 +8,10 @@ GCC.ML = 1
GCC.H = 0
GCC.W = all
GCC.archs =
+GCC.sysroot =
+GCC.ldsysroot =
+GCC.minver =
+GCC.ldminver=
GCC.vis = 0
GCC.pic = 0
GCC.g = none
@@ -40,6 +44,10 @@ GCC.args.ML = -fmessage-length=0
GCC.args.H = -H
GCC.args.W = -W$(1)
GCC.args.archs = -arch $(1)
+GCC.args.sysroot = --sysroot=$(1)
+GCC.args.ldsysroot = -syslibroot $(1)
+GCC.args.minver = -mmacosx-version-min=$(1)
+GCC.args.ldminver = -macosx_version_min $(1)
GCC.args.vis = -fvisibility=hidden
GCC.args.pic = -fPIC
GCC.args.g.none = -g0
@@ -82,6 +90,10 @@ define import.GCC
$(1).GCC.H = $$(GCC.H)
$(1).GCC.W = $$(GCC.W)
$(1).GCC.archs = $$(GCC.archs)
+ $(1).GCC.sysroot = $$(GCC.sysroot)
+ $(1).GCC.ldsysroot = $$(GCC.ldsysroot)
+ $(1).GCC.minver = $$(GCC.minver)
+ $(1).GCC.ldminver = $$(GCC.ldminver)
$(1).GCC.vis = $$(GCC.vis)
$(1).GCC.pic = $$(GCC.pic)
$(1).GCC.g = $$(GCC.g)
@@ -114,6 +126,10 @@ define import.GCC
$(1).GCC.args.H = $$(GCC.args.H)
$(1).GCC.args.W = $$(GCC.args.W)
$(1).GCC.args.archs = $$(GCC.args.archs)
+ $(1).GCC.args.sysroot = $$(GCC.args.sysroot)
+ $(1).GCC.args.ldsysroot = $$(GCC.args.ldsysroot)
+ $(1).GCC.args.minver = $$(GCC.args.minver)
+ $(1).GCC.args.ldminver = $$(GCC.args.ldminver)
$(1).GCC.args.vis = $$(GCC.args.vis)
$(1).GCC.args.pic = $$(GCC.args.pic)
$(1).GCC.args.g.none = $$(GCC.args.g.none)
@@ -149,19 +165,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 ?extra ?extra.h_o *D *I !c !o
+ $(1).GCC.H_O.args = !gcc ?pipe ?ML ?H *W *archs *sysroot *minver ?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 ?extra.c_o *D *I !c !o
+ $(1).GCC.C_O.args = !gcc ?pipe ?ML ?H *W *archs *sysroot *minver ?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 ?extra.hpp_o *D *I !c !o
+ $(1).GCC.HPP_O.args = !gxx ?pipe ?ML ?H *W *archs *sysroot *minver ?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 ?extra.cpp_o *D *I !c !o
+ $(1).GCC.CPP_O.args = !gxx ?pipe ?ML ?H *W *archs *sysroot *minver ?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))
###########################################################################
@@ -169,18 +185,18 @@ define import.GCC
$(1).GCC.i = $$(4)
# FUNCTION: C link dynamic-lib
- $(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.args = !gcc ?pipe ?strip ?dylib ?extra.dylib ?ML *W *archs *sysroot *minver ?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 ?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.args = !gcc ?pipe ?strip ?extra.exe ?ML *W *archs *sysroot *minver ?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 ?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++.args = !gxx ?pipe ?strip ?dylib ?extra.dylib++ ?ML *W *arch *sysroot *minvers ?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 ?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++.args = !gxx ?pipe ?strip ?extra.exe++ ?ML *W *archs *sysroot *minver ?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