From 6efa09710970272de8142d3b326077d46f08cb26 Mon Sep 17 00:00:00 2001 From: prigaux Date: Sun, 28 Jan 2007 14:28:53 +0000 Subject: [PATCH] MacOsX UB using precompiled universal contrib libraries git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/MediaFork_0.8.0@224 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- BuildContribsDarwin.sh | 71 ++++++++++++++++++++++++++++++++ DownloadMacOsXContribBinaries.sh | 32 ++++++++++++++ MacOsXContribBinariesVersion.txt | 1 + Makefile | 12 ++++++ 4 files changed, 116 insertions(+) create mode 100755 BuildContribsDarwin.sh create mode 100755 DownloadMacOsXContribBinaries.sh create mode 100644 MacOsXContribBinariesVersion.txt create mode 100644 Makefile diff --git a/BuildContribsDarwin.sh b/BuildContribsDarwin.sh new file mode 100755 index 000000000..40b78a6b2 --- /dev/null +++ b/BuildContribsDarwin.sh @@ -0,0 +1,71 @@ +#!/bin/sh +# This script build the contrib libs +# This used on MaxOs X to generate a universal version of the contrib libraries +# The new building process for MediaFork is to download a precompiled universal contrib folder +# and use them to build universal binaries of MediaFork +# pri: 01/28/07 +# ######################################################################## +# Parameters: +# Package Version (Version must be incremented to ensure that each of trunk/branches use the correct version) +# IP of the other platform host +# Username to connect with (passwordless must be setup between the 2 machines) +# +# ie: ./BuildContribsDarwin.sh 0001 192.168.0.150 toto +# +# ######################################################################### +# The script will connect to the other computer, download and build all of the contrib libraries +# and in the same time download and compile the contrib libraries on the native system +# My setup to do that is Mac Pro Intel as native and a Mac mini G4 ppc as foreign +# +# Native is the master computer, it sends compile commands to the foreign, get the library, then do a lipo +# to assemble both versions and put a universal binary version of the library in contrib/lib folder +# +# Once all of the contrib libraries are builded, a contribbin-darwin-${version}.tar.gz file is created, this file must +# be uploaded to the ftp server so Xcode will be able to build universal binaries of the MediaFork, MediaForkCLI and libmediafork +# +# ########################################################################## +# SSH passwordless setup instructions +# 1) log on native using terminal +# 2) ssh-keygen -t rsa +# 3) leave passphrase empty (hit return) +# 4) copy the $HOME/.ssh/id_rsa.pub to foreign machine $HOME/.ssh/authorized_keys +# ########################################################################## +export VERSION=$1 +export IP=$2 +export USERNAME=$3 +export REPOS=svn://multics.dynalias.com/HandBrake/branches/MediaFork_0.8.0 +# ########################################################################## +# Launch the build on the foreign system +# ########################################################################## +ssh $USERNAME@$IP "rm -rf MFBUILDTMP ; mkdir MFBUILDTMP ; svn co $REPOS MFBUILDTMP ; cd MFBUILDTMP ; ./configure ; cd contrib ; cp ../config.jam . ; ../jamUB ; touch BUILDTERMINATED" & +./configure +cd contrib +rm -rf lib include *tar.gz bin share man native foreign +cp ../config.jam . +# Use the new UB jam to be shure to use the correct version to build libraries (native on each system) +../jamUB +mkdir native +mv lib native +mkdir lib +mkdir foreign +# wait until the foreign build is done :) +wait +echo the foreign build is done, transferring files to native computer: +cd foreign +mkdir lib +cd lib +scp $USERNAME@$IP:/Users/$USERNAME/MFBUILDTMP/contrib/lib/*a . +for lib in `ls *.a` +do + echo ... lipo: $lib + lipo -create $lib ../../native/lib/$lib -output ../../lib/$lib +done; + +cd ../.. +echo $VERSION > DarwinContribVersion.txt +echo Creating contribbin-darwin-$VERSION.tar.gz +tar zcvf contribbin-darwin-$VERSION.tar.gz lib include DarwinContribVersion.txt +echo Done.... +ls -l contribbin-darwin-$VERSION.tar.gz +cd .. +echo $VERSION > MacOsXContribBinariesVersion.txt diff --git a/DownloadMacOsXContribBinaries.sh b/DownloadMacOsXContribBinaries.sh new file mode 100755 index 000000000..135caa13d --- /dev/null +++ b/DownloadMacOsXContribBinaries.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +# Incremented every time a new contrib package is available +VERSION=`cat MacOsXContribBinariesVersion.txt` + +if [ -f contrib/version ]; then + if [ "`cat contrib/version`" = $VERSION ]; then + echo "Contribs are up to date." + exit 0 + fi +fi + +HOST=download.m0k.org +FILE=contribbin-darwin-$VERSION.tar.gz +URL=http://download.mediafork.dynalias.com/contrib/$FILE + +# Check for internet connectivity +if ! host $HOST > /dev/null 2>&1; then + echo "Please connect to the Internet (could not resolve $HOST)." + exit 1 +fi + +# Look for something that can handle an HTTP download + WGET="curl -L -O" + +# Get and install the package +echo "Getting contribs ($VERSION)..." +( cd contrib && rm -f $FILE && $WGET $URL && rm -Rf lib include && \ + tar xzf $FILE && ranlib lib/*.a ) || exit 1 + +exit 0 + diff --git a/MacOsXContribBinariesVersion.txt b/MacOsXContribBinariesVersion.txt new file mode 100644 index 000000000..635047563 --- /dev/null +++ b/MacOsXContribBinariesVersion.txt @@ -0,0 +1 @@ +0001 diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..efd24e7c5 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +SYSTEM = $(shell uname -s) + +# Special case for Mac OS X: everything is handled from the Xcode project +ifeq ($(SYSTEM),Darwin) + +all: + (cd macosx ; xcodebuild -alltargets -configuration UB build | sed '/^$$/d' ) + +clean: + (cd macosx ; xcodebuild -alltargets -configuration UB clean | sed '/^$$/d' ) + +endif -- 2.40.0