Tutorial: Compiling from Source – Detailed Step by Step

Home Forums Development Tutorial: Compiling from Source – Detailed Step by Step

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24167
    acanavari
    Participant

    Tutorial: Compiling WiiMC from Source on Windows

    I’m going to provide a personal tutorial on how to compile WiiMC. While the instructions provided on the official website do provide all the information that is needed, I found that I ran into several issues due to changes in configuration files, missing commands, hyperlinks which weren’t quite direct, and the brevity of the instructions. I wanted to try to simplify the process for those who may have ran into similar trouble as I did.

    My goal is to provide as precise as possible instructions so that this post should provide a one stop shop to compile WiiMC without any further research.

    Instructions:

    Step 1: Download Mingw the linux “virtual environment” you will need for compiling from here:

    http://sourceforge.net/projects/mingw/files/

    Download the latest version of the executable installer on the page, for me it was: “mingw-get-inst-20120426.exe”. Run the installation and select “Use pre-packaged repository catalogues”, follow the instructions until you get to the “Select Components” page. I wasn’t quite sure what compiler(s) were needed so I checked them all just to be safe (If you’re aware of what packages you don’t need then by all means skip them).

    Step 2: Download extra shell commands

    I find using the “wget”, “svn”, and the “7za” commands quite convenient and I will be using them in the rest of the tutorial, but if you rather manually follow the links in a browser, download, and then extract files that way – be my guest.

    However, in compiling the dependencies in the “libs” folder of the latest source, I got the error “sudo: command not found”. sudo executes a command with administrative privileges in linux; however Windows works different and mingw doesn’t have the command. The link below contains not only the wget and svn commands but a “sudo” command that gets around this error. If anyone else knows another way to do so, please let me know:

    http://depositfiles.com/files/glq22ptd0

    mirror: https://www.dropbox.com/s/1zeka58ri31l8bb/Extra_Shell_Commands.rar

    The quickest way to use these files is to extract the files and copy and merge the bin folder to:
    “c:mingwbin”. However, if you want to set up environmental variables, be my guest.

    Step 3: Install devkitPPC r24 and libogc 1.8.8 or higher:

    If you installed mingw and the extra shell commands we can now do the rest through the command line. So start up a mingw shell by going to your installed programs folder. When the shell starts we will be in the root directory which is really the path “C:MinGWmsys1.0”. Enter the following commands:

    mkdir -p /opt/devkitpro

    chmod 777 /opt/devkitpro

    cd /opt/devkitpro

    wget http://sourceforge.net/projects/devkitpro/files/devkitPPC/devkitPPC_r26-win32.exe

    7za x devkitPPC_r26-win32.exe

    mkdir libogc

    cd libogc

    wget http://sourceforge.net/projects/devkitpro/files/libogc/libogc-1.8.11.1.tar.bz2

    tar -xvjf libogc-1.8.11.1.tar.bz2

    wget http://sourceforge.net/projects/devkitpro/files/libfat/libfat-ogc-1.0.11.tar.bz2

    tar -xvjf libfat-ogc-1.0.11.tar.bz2

    cd ..

    export DEVKITPRO=/opt/devkitpro

    export DEVKITPPC=$DEVKITPRO/devkitPPC

    Step 4: Download and install the ported libraries (zlib, mxml, libpng, libjpeg, and FreeType):

    mkdir -p portlibs/ppc

    cd portlibs/ppc

    wget http://sourceforge.net/projects/devkitpro/files/portlibs/ppc/zlib-1.2.5-ppc.tar.bz2

    wget http://sourceforge.net/projects/devkitpro/files/portlibs/ppc/mxml-2.6-ppc.tar.bz2

    wget http://sourceforge.net/projects/devkitpro/files/portlibs/ppc/libpng-1.5.4-ppc.tar.bz2

    wget http://sourceforge.net/projects/devkitpro/files/portlibs/ppc/jpeg-8d-ppc.tar.bz2

    wget http://sourceforge.net/projects/devkitpro/files/portlibs/ppc/freetype-2.4.2-ppc.tar.bz2

    tar xvjf zlib-1.2.5-ppc.tar.bz2

    tar xvjf mxml-2.6-ppc.tar.bz2

    tar xvjf jpeg-8d-ppc.tar.bz2

    tar xvjf freetype-2.4.2-ppc.tar.bz2

    tar xvjf libpng-1.5.4-ppc.tar.bz2

    tar xvjf libpng-1.5.4-ppc.tar.bz2

    Step 5: Download and compile libext2fs and libntfs-wii:

    svn checkout http://libext2fs-wii.googlecode.com/svn/trunk/ libext2fs-wii-read-only

    svn checkout http://libntfs-wii.googlecode.com/svn/trunk/ libntfs-wii-read-only

    cd libext2fs-wii-read-only

    make

    make install

    cd ..

    cd libntfs-wii-read-only

    make

    make install

    Step 6: Download the WiiMC source code (trunk) from SVN:

    cd /opt

    svn checkout http://wiimc.googlecode.com/svn/trunk/ wiimc-read-only

    cd wiimc-read-only

    Step 7: Compile the dependencies (fribidi, libexif, and libiconv)

    NOTE: It was at this point in the original documentation that seems (at least to me) to give problems due to unstated changes. Beginning with the fact that there is NO configuration file in the libs directory of the current source code. The configuration now appears to be part of the “make” (so that configuration and compilation occurs at the same time) so the use of Msys for configuration is unnecessary.

    Also, it is at this point that you will see that by just compiling with “make” WITHOUT inserting the “sudo” executable into the /bin folder you will get a compile error stating “error – sudo: command not found”. Another point of issue with the original instructions is the fact that following the compilation with “make install” in the libs directory will result in an error as the the makefile has no instructions for installing the binaries. You have to go into the individual libraries and install from there.

    cd libs

    make

    cd fribidi

    make install

    cd ..

    cd libexif

    make install

    cd ..

    cd libiconv

    make install

    cd ..

    cd ..

    Step 8: Now Compile the Wiimc .dol:

    make

    and after a good long compilation you should finally see the “wiimc.dol” and “wiimc.elf” files in
    “C:MinGWmsys1.0optwiimc-read-only”. And from there on I’m sure you all know what to do with those!

    Disclaimer: I am not sure if any of the “workarounds” I have used in this tutorial may cause any unnecessary issue, I am simply communicating the steps I have used to overcome the problems I encounter in compiling the source code to a successful result.

    Moreover, you should never trust binaries from an unknown source. The binaries I provided in Step 2 (except for the sudo.exe command) were taken from an installation I had of Cygwin. If you wish to install the Cygwin shell with these commands yourself, feel free for safety reasons. However, the sudo.exe command I found on this site:

    http://gloriouscomputing.wordpress.com/2009/10/16/sudo-for-windows-7vista/

    It was scanned with KIS 2012 with no virius detection.

    Please also note that the sources used in the wget commands in this tutorial are subject to change as they are updated on sourceforge. If any of the links are broken, you merely need to follow the links to their upper directory to find out the updated names for use with the “wget” commands.

    If you find any errors or mistakes in understanding in this tutorial or have any suggestions, please do not hesitate to advise me of such. Thanks!

    #30586
    cadbusca
    Participant

    I have not tested your process, but I suggest you move it to the “Development” section to replace my “Expanded Windows Compile Guide” which I no longer maintain due to the many changes, and ask Tantric to make it a sticky.

    #30587
    acanavari
    Participant

    @jhb50 wrote:

    I have not tested your process, but I suggest you move it to the “Development” section to replace my “Expanded Windows Compile Guide” which I no longer maintain due to the many changes, and ask Tantric to make it a sticky.

    Thanks for the advice. I have only been part of the forum for a short time so I still have to get use to the appropriate posting areas. However, unless I repost it, I don’t believe I have the ability to move without a moderator’s assistance.

    Moreover, while I do know that the instructions will result in a successful compilation, I wasn’t sure if there may have been some inefficiencies with the workarounds which may cause problems down the line, so I wasn’t quite sure if it was “sticky” worthy.

    In any event, hopefully it proves helpful to a few. The forums seems a bit slow, but nevertheless, this is a great project.

    #30588
    ticatc3
    Participant

    I followed this guide but the resulting .dol was less in file size than the official version; about 100 KB less.
    Videos with stylized subtitles no longer play properly. I wonder if the devkitppc or libogc version have anything to do with it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Login

Lost Password