Bug 5405 - Support building on cygwin with cross-make-mingw*.sh
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: PC other
: P3 minor
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2012-01-08 14:36 EST by q3urt.undead
Modified: 2012-07-01 12:29:55 EDT
2 users (show)

See Also:


Attachments
Fix for cygwin to build using cross-make-mingw.sh (1.88 KB, patch)
2012-01-08 14:36 EST, q3urt.undead

Description q3urt.undead 2012-01-08 14:36:57 EST
Created attachment 3066 [details]
Fix for cygwin to build using cross-make-mingw.sh

The cross-make-mingw.sh and cross-make-mingw64.sh can be used to easily build Win32/Win64 binaries using Cygwin.  It requires one change though.  'which' prints to stderr on cygwin so the existing check isn't right.  This patch uses the exit code instead so it should work on all OSes.

To build using cygwin which includes mingw gcc, you need a number of cygwin packages but they are all available in the cygwin installer.  The wiki for building on Windows could be simpler if it used cygwin rather than mingw directly.
Comment 1 Monk 2012-01-08 15:21:35 EST
Well, you can write a section on cygwin for the wiki and forums:

http://wiki.ioquake3.org/Building_ioquake3
http://ioquake.org/forums/viewforum.php?f=12

I never wrote anything for cygwin because I don't really use it and have no idea about the steps to set it up.  The how-to's I wrote assume the reader has no clue how to do anything or knows where to get it.  Hopefully a cygwin-centric one isn't just, "install cygwin, run make, that's it!"  

;)
Comment 2 q3urt.undead 2012-01-09 00:42:11 EST
Monk,

The wiki is configured weird.  Forced real name and resume upload?  No thanks.

Anyway, here is how you can build on Windows 7 64bit using the 32bit build.  Building for 64bit is easy for the client/engine but you have to track down/compile SDL, libcurl and openal on your own.  With 32bit, you can reuse the installer's copy.

These instructions work for a normal user although you will be prompted for an admin password at parts.

Get cygwin here (latest is 1.7.9-1): http://cygwin.com/setup.exe

Use the recommended settings (C:/cygwin, all users) and select a close mirror.

In the package selection area, select these in addition to the ones that cygwin has on by default.  This is close to the bare minimum needed:

Devel -> make

# For 32bit builds
Devel -> mingw64-i686-binutils
Devel -> mingw64-i686-gcc-core
Devel -> mingw64-i686-headers
Devel -> mingw64-i686-runtime

# For 64bit builds
Devel -> mingw64-x86_64-binutils
Devel -> mingw64-x86_64-gcc-core
Devel -> mingw64-x86_64-headers
Devel -> mingw64-x86_64-runtime

Devel -> subversion


Before you leave, you may want to install an editor.  Nano is easy to use but the traditional choices are vim or emacs.  It's possible to edit the files with Windows tools but less convenient without a little setup.

Click next and accept the recommendations.  They are needed for the packages that you selected above.

This will download and install cygwin.  It has many of the base utilities including bash, sed, awk, etc.  Using the above is enough to build ioquake3 as of r2214.

As far as the actual build, it's simple too:

$ svn co svn://svn.icculus.org/quake3/trunk ioquake3
$ cd ioquake3
$ sh cross-make-mingw.sh   # after it is changed with the patch in this bug report.


Then when that builds the exe and DLL in the build/ directory, you have everything that you need.  For the install, I did this:

Copy baseq3 from a quake3 installation to a new directory say C:/games/quake3
Install the ioquake3 engine (http://ioquake3.org/files/1.36/installer/ioquake3-1.36-3.1.x86.exe) into a related directory, C:/games/quake3/vanilla

The ioquake3 1.36 installer includes the necessary DLLs that the runtime needs: SDL, libcurl and openal.

$ cd /cygdrive/c/games/quake3
$ cp vanilla/*.dll .

Now you are ready to run it.  For best results, I would use non-fullscreen mode so if there is an error it is easier to see.

./ioquake3 +set r_fullscreen 0
Comment 4 q3urt.undead 2012-03-10 19:53:32 EST
(In reply to comment #3)
> Ok, how's this, then?
>
> http://wiki.ioquake3.org/Building_ioquake3_on_Windows_-_cygwin
> http://www.ioquake.org/forums/viewtopic.php?f=12&t=1707

Looks good.  Is there any chance that the *.sh will be fixed?
Comment 5 Thilo Schulz 2012-07-01 12:29:55 EDT
committed r2090, thanks.