summaryrefslogtreecommitdiffstats
path: root/make/test
diff options
context:
space:
mode:
authorkonablend <[email protected]>2012-01-04 09:41:11 +0000
committerkonablend <[email protected]>2012-01-04 09:41:11 +0000
commit6d95ab81984cc44296438270aa792255f037c89a (patch)
tree842d42f935c31a5ec8c1529605cd0226d5d29197 /make/test
parentaad50499b32c44d28a6bae7f353b579e24564e25 (diff)
BuildSystem: Mac OS X - transition to Xcode4
- transition from Xcode3 to Xcode4 - overhaul HandBrake.xcodeproj file - simplify down to 2 configurations: debug, release - add xcconfig for useful variants: osx106.i386, osx106.x86_64, osx107.i386, osx107.x86_64 - add configure --xcode-config as preferred method to choose OSX minimum version and SDK - overhaul Info.plist generation to use m4 instead of cpp - remove use of direct static libraries on command line - Xcode4 now enables -search_paths_first by default - reference external build static libraries project file - greatly simplifying project file maintenance - update universal build targets to use --xcode-config - update ffmpeg hack to build on i386 in both debug and optimized modes - update ffmpeg build to show compile verbosity - enable local yasm when yasm probe fails - remove unused GCC.ldsysroot - remove unused GCC.ldminver - enhance xcodemake to use --sysroot, --minver - update/regenerate docs accordingly - add support for configure-time repo probe when svn repo is incompatible format to Xcode via .svn/HANDBRAKE_REPO_PROBE - replaced make/test/build.matrix.darwin with make/test/build.matrix git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4395 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'make/test')
-rwxr-xr-xmake/test/build.matrix156
-rwxr-xr-xmake/test/build.matrix.darwin59
2 files changed, 156 insertions, 59 deletions
diff --git a/make/test/build.matrix b/make/test/build.matrix
new file mode 100755
index 000000000..70d07445b
--- /dev/null
+++ b/make/test/build.matrix
@@ -0,0 +1,156 @@
+#!/usr/bin/env ruby1.9
+
+## This script is used to launch a wide variety of builds for darwin.
+## It is unsupported and is meant for use only with build-system testing.
+
+require 'pathname'
+require 'thread'
+
+################################################################################
+
+class Printer < Mutex
+ def p(*args)
+ synchronize { super }
+ end
+
+ def puts(*args)
+ synchronize { super }
+ end
+end
+
+$out = Printer.new
+
+################################################################################
+
+class Build
+ def initialize(debug, xcconfig, method)
+ @debug = debug
+ @xcconfig = xcconfig
+ @method = method
+ if @xcconfig
+ @dir = '_matrix.%s.%s.%s' % [@debug[0], @xcconfig, @method]
+ else
+ @dir = '_matrix.%s.%s' % [@debug[0], @method]
+ end
+ @configure = []
+ @make = []
+ end
+
+ def doit
+ p = Pathname.new(@dir)
+ return if p.exist?
+ p.mkdir
+
+ @configure[0..0] += @debug[1].split
+ @configure[0..0] += ["--build=#{@dir}"]
+ @configure << ('--xcode-config=%s' % [@xcconfig]) if @xcconfig
+
+ @make[0..0] += ['-C', @dir]
+ end
+
+ return if !run(@configure)
+ end
+ return if !run(@make, true)
+ end
+ end
+
+private
+ def run(args, append=false)
+ s = args.join(' ')
+ $out.puts s
+ return Kernel.system('%s %s %s/matrix.log 2>&1' % [s, append ? '>>' : '>', @dir])
+ end
+end
+
+################################################################################
+
+class BuildTerminal < Build
+ def initialize(debug, xcconfig)
+ super(debug, xcconfig, 'term_make')
+ @configure += './configure --force --disable-xcode'.split
+ @make += 'make BUILD.jobs=1'.split
+ end
+end
+
+class BuildLaunch < Build
+ def initialize(debug, xcconfig)
+ super(debug, xcconfig, 'launch_make')
+ @configure += './configure --force --launch --launch-jobs=1 --disable-xcode'.split
+ end
+end
+
+class BuildTerminalXcode < Build
+ def initialize(debug, xcconfig)
+ super(debug, xcconfig, 'term_xcode')
+ @configure += './configure --force'.split
+ @make += 'make BUILD.jobs=1'.split
+ end
+end
+
+class BuildLaunchXcode < Build
+ def initialize(debug, xcconfig)
+ super(debug, xcconfig, 'launch_xcode')
+ @configure += './configure --force --launch --launch-jobs=1'.split
+ end
+end
+
+################################################################################
+
+## probe ncpu
+begin
+ case
+ when RUBY_PLATFORM =~ /darwin/
+ workload = `sysctl -n hw.activecpu 2>/dev/null`[0].to_i
+ end
+rescue
+ workload = 1
+end
+
+## create work queue
+queue = Queue.new
+
+## create xcconfig list
+xclist = []
+case
+when RUBY_PLATFORM =~ /darwin11/
+ xclist += 'native osx106.i386 osx106.x86_64 osx107.i386 osx107.x86_64'.split
+when RUBY_PLATFORM =~ /darwin10/
+ xclist += 'native osx106.i386 osx106.x86_64'.split
+end
+
+## fill queue
+[['release',''],['debug','--debug=max --optimize=none']].each do |debug|
+ [BuildTerminal, BuildLaunch].each do |kind|
+ queue << kind.new(debug, nil)
+ end
+ [BuildTerminalXcode, BuildLaunchXcode].each do |kind|
+ xclist.each do |xcconfig|
+ queue << kind.new(debug, xcconfig)
+ end
+ end
+end
+
+## process queue
+workers = (1..workload).map do |i|
+ queue << :finish
+ Thread.new() do |worker|
+ loop do
+ item = queue.pop
+ break if item == :finish
+
+ begin
+ item.doit
+ rescue SystemExit
+ break
+ rescue
+ puts 'whups'
+ end
+ end
+ end
+end
+
+## wait for all workers to finish
+workers.each(&:join)
diff --git a/make/test/build.matrix.darwin b/make/test/build.matrix.darwin
deleted file mode 100755
index 7620707b5..000000000
--- a/make/test/build.matrix.darwin
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-#
-
-## This script is used to launch a wide variety of builds for darwin.
-## It is unsupported and is meant for use only with build-system testing.
-
-if [ -z "$1" ]; then
- echo "usage: $0 BUILDPREFIX"
- exit 1
-fi
-
-set -e
-buildprefix=$1
-
-term_make() {
- eval $1="make"
- eval $2="'--disable-xcode'"
-}
-
-term_xcode() {
- eval $1="make"
- eval $2=""
-}
-
-launch_make() {
- eval $1="launch"
- eval $2="'--launch --launch-jobs=0 --launch-quiet --disable-xcode'"
-}
-
-launch_xcode() {
- eval $1="launch"
- eval $2="'--launch --launch-jobs=0 --launch-quiet'"
-}
-
-for debug in none max; do
-for arch in i386 ppc ppc64 x86_64; do
- for method in launch_make launch_xcode term_make term_xcode; do
- dir=$buildprefix.$arch.$debug.$method
- if [ -d $dir ]; then
- echo "skipping $dir"
- continue
- fi
-
- $method mode args
-
- cmd="./configure --arch=$arch --debug=$debug --build=$dir $args"
- echo $cmd | awk '{ \
- trail = ""; \
- for( i = 4; i <= NF; i++ ) \
- trail = trail " " $i; \
- printf("%-11s %-13s %-30s%s\n", $1, $2, $3, trail) }'
-
- $cmd
- if [ "$mode" = "make" ]; then
- (set -x; cd $dir && make -j8 >& log/build.txt)
- fi
- done
-done
-done