Windows: Link debug build against debug wiiuse. Can't keep linking to the release...
[dolphin.git] / osx_make_dmg.sh
blob2bfe24bf4ecf1e62e0160edcc85f008c1bd18dc3
1 #!/bin/sh
2 # OS X .dmg maker for distributable builds
3 # Courtesy of WntrMute
4 # How to use:
5 # run scons so that a complete and valid build is made in the normal Binary path
6 # run this script :)
8 trap "echo; exit" SIGINT SIGTERM
10 temp_dir="Dolphin-r`svn info | grep "Revision" | awk '{print $2}'`"
12 fix_shared_object_depends() {
13 search_string=$1
15 # Get list of files to work on
16 file_list=`find $temp_dir/Dolphin.app -name *.dylib`
18 # Loop over the files, and update the path
19 for file in ${file_list}; do
20 orig_paths=(`otool -L ${file} | grep ${search_string} | awk '{print $1}'`)
22 for orig_path in ${orig_paths[@]}; do
23 if test "x${orig_path}" != x; then
24 new_path=`echo ${orig_path} | xargs basename`
25 echo "$file\t$orig_path"
27 cp ${orig_path} $temp_dir/Dolphin.app/Contents/MacOS/${new_path}
28 install_name_tool -change ${orig_path} @executable_path/${new_path} ${file}
30 done
31 done
33 # wxw shoves all the paths into one string, so the looping is really just for dealing with wxw crap
34 orig_paths=(`otool -L $temp_dir/Dolphin.app/Contents/MacOS/Dolphin | grep ${search_string} | awk '{print $1}'`)
36 for orig_path in ${orig_paths[@]}; do
37 if test "x${orig_path}" != x; then
38 new_path=`echo ${orig_path} | xargs basename`
39 cp ${orig_path} $temp_dir/Dolphin.app/Contents/MacOS/${new_path}
40 install_name_tool -change ${orig_path} @executable_path/${new_path} $temp_dir/Dolphin.app/Contents/MacOS/Dolphin
41 echo "Fixing $orig_path"
43 done
46 cd Binary 2>/dev/null
47 if [ $? != 0 ]; then echo "Did you build dolphin yet?"; exit; fi
48 rm -rf $temp_dir
49 mkdir -p $temp_dir/Dolphin.app
50 cp -r Darwin-i386/Dolphin.app $temp_dir
51 fix_shared_object_depends libwx
53 find $temp_dir -name .svn -exec rm -fr {} \; 2>/dev/null
54 rm $temp_dir.dmg 2>/dev/null
55 echo "Creating dmg"
56 hdiutil create -srcfolder $temp_dir -format UDBZ $temp_dir.dmg
57 rm -rf $temp_dir