Although ezQuake development seems to have died down, I thought it would be interesting to build a windows client from the latest 3.0 alpha sources (even though most of the changes are to improve the OSX and Linux clients). In older versions, you used to be able to build with Visual Studio, but that is no longer the case. It took me some trial and error to figure out how to install MinGW with all the required libraries, so I wanted to document the steps here in case anyone is looking to start developing (from windows) again.
=====
Install MinGW (instructions summarized from http://www.mingw.org/wiki/Getting_Started)
=====
Now if you open a new Command Prompt (for the new environment variables to take effect), you can run MinGW and MSYS tools like "make".
=====
Install PKG-CONFIG (instructions summarized from http://www.gaia-gis.it/spatialite-3.0.0-BETA/mingw_how_to.html#pkg-config)
=====
=====
Install packages needed by PKG-CONFIG (based on http://www.multigesture.net/articles/how-to-upgrade-your-mingw-with-commonly-used-libraries/)
=====
=====
Compile EZQuake!
=====
I tried to reduce the steps and additional software required to the bare minimum, but I may have missed something.
Cheers,
BD
(Edited 2015-07-06, 21:55)
=====
Install MinGW (instructions summarized from http://www.mingw.org/wiki/Getting_Started)
=====
1- Run this package https://sourceforge.net/projects/mingw/files/latest/download
2- When done, press Continue to get to the GUI Package installer
3- Add the following Packages
a. mingw32-base
b. mingw32-libexpat (dev and dll)
c. mingw32-libz (dev and dll)
d. msys-base
e. msys-expat (bin)
f. msys-wget (bin)
and click on Installation -> Apply Changes
4- Right-click on your "My Computer" or "This PC" icon and select "Properties".
5- Click on the "Advanced" tab, then on the "Environment Variables" button.
6- Edit your PATH variable and add this to the end: ";C:\MinGW\bin;C:\MinGW\MSYS\1.0\local\bin;C:\MinGW\MSYS\1.0\bin"
NOTE: Substitute <C:\MinGW> with the FULL absolute path name of the installation target directory you chose
7- While you're here, also Create a PKG_CONFIG_PATH variable and set it to: "C:\MinGW\mingw32\lib" so that pkg-config (installed later) can find the *.pc files.
8- Go to C:\MinGW\MSYS\1.0\etc and create a file called "fstab" with notepad
9- Edit the file and ensure that it contains one line which reads:
C:\MinGW /mingw
10- Ensure that there is at least one blank line at the bottom, below all of the entries that may exist, then save and close the file.
2- When done, press Continue to get to the GUI Package installer
3- Add the following Packages
a. mingw32-base
b. mingw32-libexpat (dev and dll)
c. mingw32-libz (dev and dll)
d. msys-base
e. msys-expat (bin)
f. msys-wget (bin)
and click on Installation -> Apply Changes
4- Right-click on your "My Computer" or "This PC" icon and select "Properties".
5- Click on the "Advanced" tab, then on the "Environment Variables" button.
6- Edit your PATH variable and add this to the end: ";C:\MinGW\bin;C:\MinGW\MSYS\1.0\local\bin;C:\MinGW\MSYS\1.0\bin"
NOTE: Substitute <C:\MinGW> with the FULL absolute path name of the installation target directory you chose
7- While you're here, also Create a PKG_CONFIG_PATH variable and set it to: "C:\MinGW\mingw32\lib" so that pkg-config (installed later) can find the *.pc files.
8- Go to C:\MinGW\MSYS\1.0\etc and create a file called "fstab" with notepad
9- Edit the file and ensure that it contains one line which reads:
C:\MinGW /mingw
10- Ensure that there is at least one blank line at the bottom, below all of the entries that may exist, then save and close the file.
Now if you open a new Command Prompt (for the new environment variables to take effect), you can run MinGW and MSYS tools like "make".
=====
Install PKG-CONFIG (instructions summarized from http://www.gaia-gis.it/spatialite-3.0.0-BETA/mingw_how_to.html#pkg-config)
=====
1- Download http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
2- Unzip it and copy the bin/pkg-config.exe file to c:\MinGW\bin
3- Download http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.1-1_win32.zip
4- Unzip it and copy the bin/libglib-2.0-0.dll file to c:\MinGW\bin
5- Go to c:\MinGW\bin and copy libintl-8.dll to intl.dll
2- Unzip it and copy the bin/pkg-config.exe file to c:\MinGW\bin
3- Download http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.1-1_win32.zip
4- Unzip it and copy the bin/libglib-2.0-0.dll file to c:\MinGW\bin
5- Go to c:\MinGW\bin and copy libintl-8.dll to intl.dll
=====
Install packages needed by PKG-CONFIG (based on http://www.multigesture.net/articles/how-to-upgrade-your-mingw-with-commonly-used-libraries/)
=====
Ensure that the PKG_CONFIG_PATH environment variable has been created according to the instructions above
1- PCRE
a. Download ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. tar -zxvf pcre-8.36.tar.gz
e. cd pcre-8.36
f. ./configure --disable-cpp --disable-shared -prefix=/C/mingw
g. make
h. make install
2- CURL
a. Download http://curl.haxx.se/download/curl-7.42.0.tar.gz
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. tar -zxvf curl-7.42.0.tar.gz
e. cd curl-7.42.0
f. ./configure --disable-shared --disable-ldap -prefix=/C/mingw
g. make (note: if fails on line 3212 of url.c because trying to access member 'ntlm', see https://github.com/bagder/curl/issues/231 or use newer version of curl when available)
h. make install
3- LIBPNG
a. Download http://sourceforge.net/projects/libpng/files/libpng12/1.2.53/libpng-1.2.53.tar.gz/download
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. tar -zxvf libpng-1.2.53.tar.gz
e. cd libpng-1.2.53
f. ./configure -prefix=/C/mingw
g. make
h. make install
4- JANSSON
a. Download http://www.digip.org/jansson/releases/jansson-2.7.tar.bz2
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. bunzip2 -c jansson-2.7.tar.bz2 | tar xf -
e. cd jansson-2.7
f. ./configure -prefix=/C/mingw
g. make
h. make check
i. make install
5- Install SDL
a. Download http://libsdl.org/release/SDL2-devel-2.0.3-mingw.tar.gz and go into the SDL2-2.0.3\i686-w64-mingw32\ folder once extracted
b.Follow step #3 from https://users.cs.jmu.edu/bernstdh/web/common/help/cpp_mingw-sdl-setup.php , i.e.:
1. Copy the 4 .a files from the lib directory to the C:\MinGW\lib directory
2. Copy the SDL2 directory from the i686-w64-mingw32\include directory to the MinGW\include directory
c. SDL 2.0.3 may throw an error during compilation (see Empezar's post on page 2):
C:/MinGW/include/SDL2/SDL_platform.h:121:26: fatal error: winapifamily.h: No such file or directory #include <winapifamily.h>
If so, overwrite C:\MinGW\include\SDL2\SDL_platform.h with https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h
1- PCRE
a. Download ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. tar -zxvf pcre-8.36.tar.gz
e. cd pcre-8.36
f. ./configure --disable-cpp --disable-shared -prefix=/C/mingw
g. make
h. make install
2- CURL
a. Download http://curl.haxx.se/download/curl-7.42.0.tar.gz
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. tar -zxvf curl-7.42.0.tar.gz
e. cd curl-7.42.0
f. ./configure --disable-shared --disable-ldap -prefix=/C/mingw
g. make (note: if fails on line 3212 of url.c because trying to access member 'ntlm', see https://github.com/bagder/curl/issues/231 or use newer version of curl when available)
h. make install
3- LIBPNG
a. Download http://sourceforge.net/projects/libpng/files/libpng12/1.2.53/libpng-1.2.53.tar.gz/download
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. tar -zxvf libpng-1.2.53.tar.gz
e. cd libpng-1.2.53
f. ./configure -prefix=/C/mingw
g. make
h. make install
4- JANSSON
a. Download http://www.digip.org/jansson/releases/jansson-2.7.tar.bz2
b. Run C:\MinGW\msys\1.0\msys.bat
c. Go to where you downloaded the file (e.g. "cd /C/Users/Mark/Downloads" )
d. bunzip2 -c jansson-2.7.tar.bz2 | tar xf -
e. cd jansson-2.7
f. ./configure -prefix=/C/mingw
g. make
h. make check
i. make install
5- Install SDL
a. Download http://libsdl.org/release/SDL2-devel-2.0.3-mingw.tar.gz and go into the SDL2-2.0.3\i686-w64-mingw32\ folder once extracted
b.Follow step #3 from https://users.cs.jmu.edu/bernstdh/web/common/help/cpp_mingw-sdl-setup.php , i.e.:
1. Copy the 4 .a files from the lib directory to the C:\MinGW\lib directory
2. Copy the SDL2 directory from the i686-w64-mingw32\include directory to the MinGW\include directory
c. SDL 2.0.3 may throw an error during compilation (see Empezar's post on page 2):
C:/MinGW/include/SDL2/SDL_platform.h:121:26: fatal error: winapifamily.h: No such file or directory #include <winapifamily.h>
If so, overwrite C:\MinGW\include\SDL2\SDL_platform.h with https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h
=====
Compile EZQuake!
=====
1- make sure you have git installed and run "git clone https://github.com/ezQuake/ezquake-source.git"
2- go to the ezquake-source directory and create a file called ".config" with the following:
CONFIG_WINDOWS=TRUE
CFLAGS=-m32 -O3 -g0 -D_DEBUG -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0501 -D__USE_MINGW_ANSI_STDIO -DWITH_WINAMP
CC=mingw32-gcc
PCRE_CFLAGS=-DPCRE_STATIC
#PCRE_LIBS=/C:/MinGW/lib/libpcre.a
CURL_CFLAGS=-DCURL_STATICLIB
#CURL_LIBS=-lcurl
#CURL_LIBS=/C:/MinGW/lib/libcurl.a
SPEEX_LIBS=
#EXPAT_LIBS=/C:/MinGW/lib/libexpat.a
#ZLIB_LIBS=/C:/MinGW/lib/libz.a
SDL2_CFLAGS=-I/C:/MinGW/include/SDL2 -Dmain=SDL_main
SDL2_LIBS=/C:/MinGW/lib/libSDL2.a -lole32 -limm32 -lcomctl32 -lversion -loleaut32 -lmingw32 -lSDL2main -lSDL2 -mwindows
WINDRES=mingw32-windres
STRIP=mingw32-strip
LDFLAGS=-static -mwindows
3- make
4- "make strip" to remove debugging stuff and reduce the size of the binary by about 50%
5- copy the new ezquake.exe to your quake folder
6- enjoy!
2- go to the ezquake-source directory and create a file called ".config" with the following:
CONFIG_WINDOWS=TRUE
CFLAGS=-m32 -O3 -g0 -D_DEBUG -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0501 -D__USE_MINGW_ANSI_STDIO -DWITH_WINAMP
CC=mingw32-gcc
PCRE_CFLAGS=-DPCRE_STATIC
#PCRE_LIBS=/C:/MinGW/lib/libpcre.a
CURL_CFLAGS=-DCURL_STATICLIB
#CURL_LIBS=-lcurl
#CURL_LIBS=/C:/MinGW/lib/libcurl.a
SPEEX_LIBS=
#EXPAT_LIBS=/C:/MinGW/lib/libexpat.a
#ZLIB_LIBS=/C:/MinGW/lib/libz.a
SDL2_CFLAGS=-I/C:/MinGW/include/SDL2 -Dmain=SDL_main
SDL2_LIBS=/C:/MinGW/lib/libSDL2.a -lole32 -limm32 -lcomctl32 -lversion -loleaut32 -lmingw32 -lSDL2main -lSDL2 -mwindows
WINDRES=mingw32-windres
STRIP=mingw32-strip
LDFLAGS=-static -mwindows
3- make
4- "make strip" to remove debugging stuff and reduce the size of the binary by about 50%
5- copy the new ezquake.exe to your quake folder
6- enjoy!
I tried to reduce the steps and additional software required to the bare minimum, but I may have missed something.
Cheers,
BD
(Edited 2015-07-06, 21:55)