diff options
author | konablend <[email protected]> | 2009-03-04 00:54:53 +0000 |
---|---|---|
committer | konablend <[email protected]> | 2009-03-04 00:54:53 +0000 |
commit | 6d2d51974af122bdfe6eb82f355e270cd66c48af (patch) | |
tree | 5a82b3790f4dd0c3f71aa1643838e937edca597a /make | |
parent | c4d9c49de0f020f451325dbb39b97642eaf96032 (diff) |
BuildSystem: darwin
- made Xcode external targets consistent for each configuration.
- shunted terminal NAME=VALUE vars through xcodebuild.
- folded macosx/module.xcode shunt functions into single.
- added new report target to show a single var; eg: make report.var NAME=GCC.gcc .
BuildSystem: darwin ppc
- fixed configure on ppc host: correctly identify native architecture.
- fixed configure to be more resilient when svn probes fail.
- fixed configure to show error output for svn probes.
BuildSystme: xcode
- added external target 'external' to represent 'all things in external system'
which is slight more than what 'libhb' might represent.
- added doc section Building.osx: External Targets .
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2214 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'make')
-rw-r--r-- | make/configure.py | 60 | ||||
-rw-r--r-- | make/include/base.rules | 8 | ||||
-rw-r--r-- | make/include/report.defs | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | make/xcodemake (renamed from make/xcodemake.sh) | 64 |
4 files changed, 82 insertions, 57 deletions
diff --git a/make/configure.py b/make/configure.py index 2f8cf6e00..59a512fb8 100644 --- a/make/configure.py +++ b/make/configure.py @@ -141,7 +141,7 @@ class Guess: self.release = '' self.extra = '' elif re.match( 'darwin', p_system ): - self.machine = p_machine + self.machine = p_processor self.vendor = 'apple' self.system = p_system self.systemc = p_systemc @@ -263,7 +263,13 @@ class OptionMode( list ): self.mode = self.default def __str__( self ): - return ' '.join( self ).replace( self.mode, '*'+self.mode ) + s = '' + for a in self: + if a == self.mode: + s += ' *' + a + else: + s += ' ' + a + return s[1:] def addToGroup( self, group, option, name ): group.add_option( '', option, help='select %s mode: %s' % (name,self), default=self.mode, metavar='MODE' ) @@ -435,38 +441,40 @@ class Repository: # parse output: svnversion PROJECT_DIR cmd = 'svnversion ' + initial_project_dir - print 'running: %s' % (cmd) + print 'attempting to probe subversion: %s' % (cmd) try: - p = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) + p = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE ) p.wait(); - if p.returncode == 0: - self.wcversion = p.stdout.readline().rstrip() + if p.returncode: + sys.exit( 1 ) + self.wcversion = p.stdout.readline().rstrip() except: pass # parse output: svn info PROJECT_DIR cmd = 'svn info ' + initial_project_dir - print 'running: %s' % (cmd) + print 'attempting to probe subversion: %s' % (cmd) try: - p = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) + p = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE ) p.wait(); - if p.returncode == 0: - for line in p.stdout: - (name,value) = re.match( '([^:]+):\\s+(.+)', line.rstrip() ).groups() - if name == 'URL': - self.url = value - elif name == 'Repository Root': - self.root = value - elif name == 'Repository UUID': - self.uuid = value - elif name == 'Revision': - self.rev = int( value ) - elif name == 'Last Changed Date': - # strip chars in parens - if value.find( ' (' ): - self.date = value[0:value.find(' (')] - else: - self.date = value + if p.returncode: + sys.exit( 1 ) + for line in p.stdout: + (name,value) = re.match( '([^:]+):\\s+(.+)', line.rstrip() ).groups() + if name == 'URL': + self.url = value + elif name == 'Repository Root': + self.root = value + elif name == 'Repository UUID': + self.uuid = value + elif name == 'Revision': + self.rev = int( value ) + elif name == 'Last Changed Date': + # strip chars in parens + if value.find( ' (' ): + self.date = value[0:value.find(' (')] + else: + self.date = value except: pass @@ -629,7 +637,7 @@ config.add( 'HB.version.major', project.vmajor ) config.add( 'HB.version.minor', project.vminor ) config.add( 'HB.version.point', project.vpoint ) config.add( 'HB.version', project.version ) -config.add( 'HB.version.hex', '%04x%02x%02x%02x%06x' % (project.vmajor,project.vminor,project.vpoint,0,repo.rev) ) +config.add( 'HB.version.hex', '%04x%02x%02x%08x' % (project.vmajor,project.vminor,project.vpoint,repo.rev) ) config.add( 'HB.build', project.build ) diff --git a/make/include/base.rules b/make/include/base.rules index f12886432..fd90d7769 100644 --- a/make/include/base.rules +++ b/make/include/base.rules @@ -1,16 +1,16 @@ -.PHONY: report.main report.gcc report.modules +.PHONY: report.main report.gcc report.modules report.var report.true report.modules:: -.PHONY: report.main report.main: @$(MAKE) report.true REPORT=main -.PHONY: report.gcc report.gcc: @$(MAKE) report.true REPORT=gcc +report.var: + @$(MAKE) report.true REPORT=var + ## needed for nested make (which drives each report) -.PHONY: report.true report.true: @true diff --git a/make/include/report.defs b/make/include/report.defs index 858c45523..7962a6631 100644 --- a/make/include/report.defs +++ b/make/include/report.defs @@ -53,3 +53,10 @@ $(info ######################################################################### $(info $(foreach v,$(sort $(filter GCC.%,$(.VARIABLES))),$(call fn.PRINTVAR,$v))) $(info ) endif + +## report: var +## +ifeq (var,$(REPORT)) +$(info $(call fn.PRINTVAR,$(NAME))) +$(info ) +endif diff --git a/make/xcodemake.sh b/make/xcodemake index 5354b54cc..a75cd3ed6 100644..100755 --- a/make/xcodemake.sh +++ b/make/xcodemake @@ -1,6 +1,8 @@ -#!/bin/sh -ex +#!/bin/sh # +set -e + ## This script is invoked by Xcode external targets. ## ## We must guarantee no jobserver is passed through since the file-descriptors @@ -8,6 +10,7 @@ ## it is allowed to run an infinite number of jobs. ## MAKEFLAGS= +MFLAGS= cd $EXTERNAL_BUILD @@ -43,33 +46,40 @@ else jobs=--jobs=$EXTERNAL_JOBS fi -## compute target -case "$1:$2" in -contrib:clean) - target=contrib.xclean - ;; -contrib:*) - target=contrib.install - ;; -*:clean) - target=clean - ;; -libhb:'') - if [ -z "$EXTERNAL_GOALS" ]; then - target=build - else - target="$EXTERNAL_GOALS" - fi - ;; -*:'') - target=build - ;; -*) - echo "usage: $0 PRODUCT ACTION" - exit 1 - ;; +spec="$TARGET_NAME:$ACTION" +echo "env specification: $spec" + +## compute goals +case "$spec" in + contrib:clean) + goals=contrib.xclean + ;; + contrib:*) + goals=contrib.install + ;; + external:clean) + goals=clean + ;; + external:*) + if [ -z "$EXTERNAL_GOALS" ]; then + goals=build + else + goals="$EXTERNAL_GOALS" + fi + vars="$EXTERNAL_VARS" + ;; + libhb:clean) + goals=libhb.clean + ;; + libhb:*) + goals=libhb.build + ;; + *) + echo "ERROR: invalid env specification: $spec" + exit 1 + ;; esac ## handoff set -x -exec make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $target +make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $goals $vars |