Sonic and Sega Retro Message Board: HOWTO: Compile Gens/GS II on Windows - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 
Page 1 of 1

HOWTO: Compile Gens/GS II on Windows

#1 User is offline GerbilSoft 

Posted 04 February 2011 - 11:48 PM

  • RickRotate'd.
  • Posts: 1600
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
I previously posted a HOWTO for compiling Gens/GS on Windows, but since Gens/GS II uses a different build system, it requires a new HOWTO. Thankfully, this one will be easier, thanks to the newer toolchain.

(Note: I will start automating Win32 snapshot builds once I get framedropping implemented. Until then, this build method is intended for developers only. All complaints about the availability of precompiled builds before then will be deleted.)

(Note 2: In this tutorial, I'm giving instructions for installing things for All Users. If you want to use Current User only, that's fine; just change the relevant steps.)

UPDATE [2011/02/05 01:05 AM EST]: Gens/GS II now includes a copy of GLEW, so it's no longer necessary to install it separately.

What's required:
  • MinGW-w64 and MSYS
  • nasm
  • Git (version control system)
  • CMake 2.8 (build system)
  • Qt 4.6.0 or later (4.7.1 recommended)
  • Portaudio v19 snapshot

How to get everything set up:

--------------------------------

Installing MinGW and msys:

1. Download the MinGW-w64/i686 toolchain: http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Automated Builds/mingw-w32-1.0-bin_i686-mingw_20101129.zip/download

2. Extract mingw-w32-1.0-bin_i686-mingw_20101129.zip to C:\MinGW\.

3. Download the latest MSYS: http://sourceforge.net/projects/mingw-w64/...20%2832-bit%29/ (make sure you don't download an SRC package.)

4. Extract the MSYS directory from MSYS-20110112.zip (or whatever the latest version is) to C:\.

5. Open C:\MSYS\MSYS.BAT. This will open an MSYS window.

6. msys expects certain files to have certain names, so run the following command to fix this:
  • for FILE in /c/MinGW/bin/i686-w64-mingw32-*.exe; do cp -av $FILE /c/MinGW/bin/${FILE:30}; done

7. In the MSYS window, run the following command:
  • sh /postinstall/pi.sh

Enter 'y' for the first two questions. When it asks you for the MinGW installation directory, enter "C:/mingw" (without quotes).

8. MinGW-w64 seems to be missing some legacy DirectX headers (dsound.h, ddraw.h, etc), so download http://gerbilsoft.soniccenter.org/gens/gen...n32_headers.zip and extract the files.

9. MinGW-w64 is also missing the glext.h header. (GLEW has replacements for the glext definitions, but GLEW is currently optional. I'll include a built-in version of GLEW later to eliminate this dependency.) Download glext.h at http://www.opengl.org/registry/api/glext.h and copy it to C:\MinGW\i686-w64-mingw32\include\ .

--------------------------------

Installing nasm:

1. Download nasm: http://www.nasm.us/pub/nasm/releasebuilds/...09.04-win32.zip

2. Copy nasm.exe from the ZIP file to C:\MSYS\bin.

Installing Git:

1. Download Git: http://code.google.com/p/msysgit/ - select the latest Git-1.7.4-preview*.exe. (* is replaced by the build date.)

2. Run Git-1.7.4-preview*.exe. You can customize the various options, but make sure that you select these options specifically:
  • Install to: C:\Git
  • "Adjusting your PATH environment": Select "Run Git from the Windows Command Prompt".
  • "Configuring the line ending conversions": Select "Checkout as-is, commint Unix-style line endings". MSYS has problems with Windows-style line endings. (If you want to edit the sources, you'll need to use a text editor that supports Unix-style line endings, such as Notepad++.)

--------------------------------

Installing Qt:

1. Download the Qt framework: http://qt.nokia.com/downloads - select LGPL, and select "Qt libraries 4.7.1 for Windows". (Direct link to 4.7.1: http://get.qt.nokia......7.1-mingw.exe) Note that the framework includes all the Qt source, libraries, and debug libraries, so it's a fairly large download. (319 MB for the MinGW version.)

2. Install Qt. Select the default options for everything. When it asks for the MinGW installation, enter C:\MinGW. It may complain that some files are missing, but continue anyway.

3. Create environment variables for Qt. On Windows 2000 and XP, go to the System control panel, select the Advanced tab, then click "Environment Variables". If a PATH variable exists in User variables, double-click it; otherwise, click New and set the variable name to PATH. Add the value "C:\Qt\4.7.1\bin" (without quotes) to the path. (Directories are separated by semicolons.) Also, create a new variable called QTDIR, and set its value to "C:\Qt\4.7.1" (without quotes). Click OK on everything and close the System control panel.

Installing CMake:

1. Download the CMake installer for Windows: http://www.cmake.org/cmake/resources/software.html (Direct link to 2.8.3: http://www.cmake.org...3-win32-x86.exe)

2. Install CMake. When it asks to add CMake to the system path, select "Add CMake to the system PATH for all users". Accept the defaults for everything else.

--------------------------------

Compiling and installing PortAudio:

1. Open the MSYS shell if it isn't already open: C:\MSYS\MSYS.bat (if it's already open, type "cd ~" (without quotes) and press enter.)

2. Get the latest PortAudio snapshot: http://www.portaudio.com/archives/pa_snapshot.tgz - copy this to C:\MSYS\home\username, where username is your system username. Extract the snapshot by running this command:
  • tar xpfvz pa_snapshot.tgz

3. Compile and install PortAudio by typing the following commands:
  • cd portaudio/
  • ./configure —prefix=/mingw/i686-w64-mingw32/ —build=i686-w64-mingw32 —host=i686-w64-mingw32 —target=i686-w64-mingw32 —with-winapi=wmme,directx —with-dxdir=/mingw/i686-w64-mingw32/
  • make lib/libportaudio.la
  • make install

The build, host, and target specifications are required, since autoconf assumes that you want to use the old mingw (i686-pc-mingw32) compiler by default when using MSYS. We're using the newer mingw-w64 compiler.

--------------------------------

Compiling and installing Gens/GS II:

1. While still in the MSYS shell, change back to your home directory:
  • cd ~

2. Get the latest Gens/GS II sources from git:
  • /c/Git/bin/git clone git://gs_server.gerbilsoft.ddns.info/srv/git/gens-gs-ii.git

3. Run CMake to generate the Makefiles:
  • cd gens-gs-ii/
  • mkdir build/
  • cd build/
  • cmake ../ -G "MSYS Makefiles"

4. Build Gens/GS II by typing "make" (without quotes) and press enter.

5. After Gens/GS II is finished compiling, type the following commands to run it:
  • cd src/gens-qt4/
  • gens-qt4

If all goes well, Gens/GS II should load.
This post has been edited by Overlord: 05 February 2011 - 07:00 PM

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users