diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 7ea2b4073..5843e1f26 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.2: +- Updated mingw support with better directions, and easier build -PBlue - PCMenus now suports 'settings', and menu font is correct -PhracturedBlue - Added '-b' option to get PC Menus -PhracturedBlue - Check for a deadlock in savedgames and try to continue -PhracturedBlue diff --git a/sc2/INSTALL.mingw b/sc2/INSTALL.mingw index 053b40ab1..369f3133a 100644 --- a/sc2/INSTALL.mingw +++ b/sc2/INSTALL.mingw @@ -7,12 +7,31 @@ First, download and install the latest version of MinGW and then MSYS. You'll need all the libraries described in the INSTALL file in CVS. You don't have to build SDL_mixer yourself -- just download OpenAL. -Copy the DLLs for each library to \[MinGW]\lib. Copy the header files for +You should get the 'mingw' development build for SDL, and follow the +instructions to install it into mingw. All others will be either for win32 +or VC + +These are the files you need to download: + +http://www.libsdl.org/release/SDL-devel-1.2.5a-mingw32.tar.gz +http://www.libsdl.org/projects/SDL_image/release/SDL_image-devel-1.2.2-VC6.zip +ftp://opensource.creative.com/pub/sdk/OpenALSDK.exe +http://www.vorbis.com/files/1.0/windows/OggVorbis-win32sdk-1.0.zip + +you can now do either of the following: +1) Copy the DLLs for each library to \[MinGW]\lib. Copy the header files for each library to \[MinGW]\include, (where [MinGW] is the directory where you installed MinGW) except for the Ogg Vorbis headers -- copy the folders (ogg and vorbis) containing the header files to the include directory. -Rename OpenAL32.dll to openal.dll. +2) within MSYS set C_INSTALL_PATH and LIBRARY_PATH to point at all of the +respective include and library dirs where you installed them. i.e. something +like: +export C_INCLUDE_PATH=/mingw/include/SDL:/c/VClibs/SDL_image-1.2.2/include/:/c/VClibs/OpenAL\ 1.0\ SDK/Include/:/c/VClibs/oggvorbis-win32sdk-1.0/include/ + +export LIBRARY_PATH=/c/VClibs/SDL_image-1.2.2/lib/:/c/VClibs/OpenAL\ 1.0\ SDK/libs/:/c/VClibs/oggvorbis-win32sdk-1.0/lib/ + +NOTE: If you use the 2nd methood above, you need to include the path to SDL in C_INCLUDE_PATH (but not in LIBRARY_PATH) The Ogg Vorbis headers want a header that is not included with MinGW. To get this file, download @@ -24,9 +43,16 @@ Start menu and on the desktop). cd to the UQM directory. It'll be at /[drive letter]/[path to uqm]. +./build.sh uqm config + +It should correctly detect everything, and give you a menu. +Now turn off OpenGL, as it doesn't work with mingw yet + +Next run './build.sh uqm depend' (just to be sure) +and lastly: ./build.sh uqm -Follow the instructions and it should build successfully. +If you did everything correctly, it should ow build successfully. To run the built executable, you should copy all the required DLLs to the same directory the executable is in, or copy them to your Windows diff --git a/sc2/Makefile.build b/sc2/Makefile.build index 0e6da6fde..0d820c948 100644 --- a/sc2/Makefile.build +++ b/sc2/Makefile.build @@ -9,7 +9,7 @@ default: $(COMPILE) -o $@ -c $(CFLAGS) $< target-%: - $(COMPILE) $(LDFLAGS) -o $* $^ + $(COMPILE) -o $* $^ $(LDFLAGS) -include $(DEPEND_FILE) diff --git a/sc2/build/config_proginfo b/sc2/build/config_proginfo index c6632af32..9f517dd11 100644 --- a/sc2/build/config_proginfo +++ b/sc2/build/config_proginfo @@ -74,6 +74,8 @@ LIB_openal_NAME="OpenAL" LIB_openal_CFLAGS="" if [ `uname` = 'FreeBSD' ]; then LIB_openal_LDFLAGS="-L/usr/local/lib -pthread -lopenal" +elif [ `uname | $PROG_sed_FILE s/^MINGW32.*$/MINGW32/` = 'MINGW32' ]; then + LIB_openal_LDFLAGS="-lopenal32" else LIB_openal_LDFLAGS="-lopenal" fi @@ -84,6 +86,9 @@ LIB_opengl_NAME="OpenGL" if [ `uname` = 'FreeBSD' ]; then LIB_opengl_CFLAGS="-I/usr/X11R6/include -D_THREAD_SAFE" LIB_opengl_LDFLAGS="-L/usr/X11R6/lib -lX11 -lXext -pthread -lGL" +elif [ `uname | $PROG_sed_FILE s/^MINGW32.*$/MINGW32/` = 'MINGW32' ]; then + LIB_opengl_CFLAGS="" + LIB_opengl_LDFLAGS="-lopengl32" else LIB_opengl_CFLAGS="" LIB_opengl_LDFLAGS="-lGL" diff --git a/sc2/src/port.h b/sc2/src/port.h index 95f45fdd4..3cdf4cea7 100644 --- a/sc2/src/port.h +++ b/sc2/src/port.h @@ -3,7 +3,7 @@ #include "config.h" -#ifdef WIN32 +#ifdef _MSC_VER #define alloca _alloca #define snprintf _snprintf #endif diff --git a/sc2/src/sc2code/libs/file.h b/sc2/src/sc2code/libs/file.h index 823c7931a..9d42f6c67 100644 --- a/sc2/src/sc2code/libs/file.h +++ b/sc2/src/sc2code/libs/file.h @@ -26,7 +26,7 @@ /* PATH_MAX is per POSIX defined in */ # include #endif -#ifdef WIN32 +#ifdef _MSC_VER # include # define access _access # define F_OK 0 diff --git a/sc2/src/sc2code/libs/graphics/sdl/opengl.h b/sc2/src/sc2code/libs/graphics/sdl/opengl.h index 9678c06da..809bd8196 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/opengl.h +++ b/sc2/src/sc2code/libs/graphics/sdl/opengl.h @@ -38,7 +38,7 @@ SDL_Surface* TFB_GL_DisplayFormatAlpha (SDL_Surface *surface); #ifndef APIENTRY #define GLUT_APIENTRY_DEFINED -#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) +#if __MINGW32__ || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) #define APIENTRY __stdcall #else #define APIENTRY