måndag 24 januari 2011

Building WiiMC on a Mac OS X

WiiMC is a homebrew program for Wii.
These are my bash notes on how to downloads a devkitPPC environment, install some libraries needed, and to show where to patch a file to make it compile.

Here are the bash commands...   Use them with care...  :-)



 
export WIIROOT=$(pwd)
 
svn checkout http://wiimc.googlecode.com/svn/trunk/ wiimc-read-only
svn checkout http://libext2fs-wii.googlecode.com/svn/trunk/ libext2fs-wii-read-only
svn checkout http://grrlib.googlecode.com/svn/trunk/GRRLIB/lib/zlib
 
export WIIMCSRC=$WIIROOT/wiimc-read-only
 
 
mkdir -p $WIIROOT/devkitpro
export DEVKITPRO=$WIIROOT/devkitpro
 
echo THIS IS IMPORTANT
echo export DEVKITPPC=$DEVKITPRO/devkitPPC
echo export PATH=$DEVKITPPC/bin:$PATH
 
export DEVKITPPC=$DEVKITPRO/devkitPPC
export PATH=$DEVKITPPC/bin:$PATH
 
 
mkdir -p $WIIROOT/download
cd $WIIROOT/download
 
DEVKITURL=http://sourceforge.net/projects/devkitpro/files
 
(
wget -c ${DEVKITURL}/devkitPPC/devkitPPC_r22-osx.tar.bz2 &
wget -c ${DEVKITURL}/libogc/libogc-1.8.6.tar.bz2 &
wget -c ${DEVKITURL}/examples/wii/wii-examples-20100930.tar.bz2 &
wget -c ${DEVKITURL}/examples/gamecube/gamecube-examples-20100930.tar.bz2 &
wget -c ${DEVKITURL}/libfat/libfat-ogc-1.0.8.tar.bz2 &
 
# wget -c ${DEVKITURL}/portlibs/zlib-1.2.4-ppc.tar.bz2 &
wget -c ${DEVKITURL}/portlibs/mxml-2.6-ppc.tar.bz2 &
wget -c ${DEVKITURL}/portlibs/libpng-1.4.1-ppc.tar.bz2 &
wget -c ${DEVKITURL}/portlibs/jpeg8a-ppc.tar.bz2 &
wget -c ${DEVKITURL}/portlibs/freetype-2.4.2-ppc.tar.bz2 &
wait
)
 
diff <(md5 *bz2) <(cat << EOF
MD5 (devkitPPC_r22-osx.tar.bz2) = 385300a31c4c2cc6890adfb8f220674c
MD5 (freetype-2.4.2-ppc.tar.bz2) = 0e91ad37ead10137cc9f8d2f3454a245
MD5 (gamecube-examples-20100930.tar.bz2) = e9ef264a5c7acd6ef6144b676527bacd
MD5 (jpeg8a-ppc.tar.bz2) = ef4c03019ade885dbba05982e777ea2b
MD5 (libfat-ogc-1.0.8.tar.bz2) = 495cb164afa9ca420fd21d4c78c0723f
MD5 (libogc-1.8.6.tar.bz2) = 5be16c7c972e8c92e637220adb123be1
MD5 (libpng-1.4.1-ppc.tar.bz2) = 29a9a6c754d32990f542990d3d38e715
MD5 (mxml-2.6-ppc.tar.bz2) = b196036aa9f0b310efb6bdc4b02614dc
MD5 (wii-examples-20100930.tar.bz2) = 5a37fb6cc1704f43cb3813ddbb964a24
EOF) 
 
#MD5 (zlib-1.2.4-ppc.tar.bz2) = c952918d7fb3e52e8fa66fa09f2edf87
 
 
if [ ! $? ] ; then
    echo The checksums on the downloaded files were wrong.
    exit 1
fi
 
cd $WIIROOT/download
 
tar -C $DEVKITPRO -xjf devkitPPC_r22-osx.tar.bz2
 
mkdir $DEVKITPRO/libogc
tar -C $DEVKITPRO/libogc -xjf libogc-1.8.6.tar.bz2
tar -C $DEVKITPRO/libogc -xjf libfat-ogc-1.0.8.tar.bz2
 
mkdir -p $DEVKITPRO/examples/{wii,gamecube}
tar -C $DEVKITPRO/examples/wii  -jxf wii-examples-20100930.tar.bz2
tar -C $DEVKITPRO/examples/gamecube  -jxf gamecube-examples-20100930.tar.bz2
 
mkdir -p $DEVKITPRO/portlibs/ppc
#tar -C $DEVKITPRO/portlibs/ppc -xjf zlib-1.2.4-ppc.tar.bz2
tar -C $DEVKITPRO/portlibs/ppc -xjf mxml-2.6-ppc.tar.bz2
tar -C $DEVKITPRO/portlibs/ppc -xjf libpng-1.4.1-ppc.tar.bz2
tar -C $DEVKITPRO/portlibs/ppc -xjf jpeg8a-ppc.tar.bz2
tar -C $DEVKITPRO/portlibs/ppc -xjf freetype-2.4.2-ppc.tar.bz2
 
 
############################################
 
 
cd $WIIMCSRC/libs/libntfs
make
make install
 
# remember: the powerpc-eabi commands must be in the path 
# so that 'configure' can find them)
 
for lib in fribidi libexif pcre libiconv ; do
  echo Building $lib.  Press RETURN to start
  read
  cd $WIIMCSRC/libs/$lib
  ./configure --host=powerpc-eabi --prefix="${DEVKITPRO}/portlibs/ppc" --libdir="${DEVKITPRO}/portlibs/ppc/lib" --disable-shared
  make
  make install
done
 
cd $WIIROOT/libext2fs-wii-read-only
make
make install
 
 
#install zlib 1.2.5 instead of 1.2.4 which is what we got from the devkitpro site
cd $WIIROOT/zlib
make
make install
cp $DEVKITPRO/libogc/include/{zconf,zlib}.h $DEVKITPRO/portlibs/ppc/include
cp $DEVKITPRO/libogc/lib/wii/libz.a $DEVKITPRO/portlibs/ppc/lib/libz.a 
#sed -i -e 's/1\.2\.4/1\.2\.5/' $DEVKITPRO/portlibs/ppc/lib/pkgconfig/zlib.pc
 
 
# fix missing include file in wiimc.cpp
 
===================================================================
--- source/wiimc.cpp    (revision 802)
+++ source/wiimc.cpp    (working copy)
@@ -14,6 +14,7 @@
 #include <dirent.h>
 #include <wiiuse/wpad.h>
 #include <di/di.h>
+#include <sys/iosupport.h>
 
 #include "utils/FreeTypeGX.h"
 #include "utils/gettext.h"
 
 
 
cd $WIIMCSRC
make

Inga kommentarer:

Skicka en kommentar