OSDN Git Service

add win/C# diff files
[handbrake-jp/handbrake-jp.git] / BuildContribsDarwin.sh
1 #!/bin/sh
2 # This script build the contrib libs
3 # This used on MaxOs X to generate a universal version of the contrib libraries
4 # The new building process for HandBrake is to download a precompiled universal contrib folder
5 # and use them to build universal binaries of HandBrake
6 # pri: 01/28/07
7 # ########################################################################
8 # Parameters:
9 # Package Version  (Version must be incremented to ensure that each of trunk/branches use the correct version)
10 # IP of the other platform host
11 # Username to connect with (passwordless must be setup between the 2 machines)
12
13 # ie:  ./BuildContribsDarwin.sh 0001 192.168.0.150 toto
14 #
15 # #########################################################################
16 # The script will connect to the other computer, download and build all of the contrib libraries
17 # and in the same time download and compile the contrib libraries on the native system
18 # My setup to do that is Mac Pro Intel as native and a Mac mini G4 ppc as foreign
19 #
20 # Native is the master computer, it sends compile commands to the foreign, get the library, then do a lipo 
21 # to assemble both versions and put a universal binary version of the library in contrib/lib folder
22 #
23 # Once all of the contrib libraries are builded, a contribbin-darwin-${version}.tar.gz file is created, this file must
24 # be uploaded to the ftp server so Xcode will be able to build universal binaries of the HandBrake, HandBrakeCLI and libhb
25 #
26 # ##########################################################################
27 # SSH passwordless setup instructions
28 # 1) log on native using terminal
29 # 2) ssh-keygen -t rsa
30 # 3) leave passphrase empty (hit return)
31 # 4) copy the $HOME/.ssh/id_rsa.pub to foreign machine $HOME/.ssh/authorized_keys
32 # ##########################################################################
33 export VERSION=$1
34 export IP=$2
35 export USERNAME=$3
36 export REPOS=svn://svn.handbrake.fr/HandBrake/trunk
37 # ##########################################################################
38 # Launch the build on the foreign system
39 # ##########################################################################
40 ssh $USERNAME@$IP "rm -rf HBBUILDTMP ; mkdir HBBUILDTMP ; svn co $REPOS HBBUILDTMP ; cd HBBUILDTMP ; ./configure ; cd contrib ; cp ../config.jam . ; ../jam ; touch BUILDTERMINATED" &
41 ./configure
42 cd contrib
43 rm -rf lib include *tar.gz bin share man native foreign
44 cp ../config.jam .
45 # Use the new UB jam to be shure to use the correct version to build libraries (native on each system)
46 ../jam
47 mkdir native
48 mv lib native
49 mkdir lib
50 mkdir foreign
51 # wait until the foreign build is done :)
52 wait
53 echo the foreign build is done, transferring files to native computer:
54 cd foreign
55 mkdir lib
56 cd lib
57 scp $USERNAME@$IP:/Users/$USERNAME/HBBUILDTMP/contrib/lib/*a .
58 for lib in `ls *.a`
59 do      
60         echo ... lipo contrib libraries: $lib
61         lipo -create $lib ../../native/lib/$lib -output ../../lib/$lib
62 done;
63  
64
65 cd ../..
66 echo $VERSION > DarwinContribVersion.txt
67 echo Creating contribbin-darwin-$VERSION.tar.gz
68 tar zcvf contribbin-darwin-$VERSION.tar.gz lib include  DarwinContribVersion.txt
69 echo Done....
70 ls -l contribbin-darwin-$VERSION.tar.gz
71 cd ..
72 echo $VERSION > MacOsXContribBinariesVersion.txt