diff options
29 files changed, 303 insertions, 85 deletions
@@ -41,6 +41,10 @@ export NANBLENDERHOME=$(shell pwd) MAKEFLAGS=-I$(NANBLENDERHOME)/source --no-print-directory SOURCEDIR = blender +ifeq ($(FREE_WINDOWS),true) + DIRS ?= dlltool intern source po +endif + DIRS ?= extern intern source po include source/nan_subdirs.mk diff --git a/doc/README.windows-gcc b/doc/README.windows-gcc new file mode 100644 index 00000000000..e20e7ff5585 --- /dev/null +++ b/doc/README.windows-gcc @@ -0,0 +1,91 @@ +Here are some basic instructions for building +blender blender for windows using gcc under cygwin. +Please note that the resulting executable does not +depend on cygwin and can be distrubuted to machines +that don't have cygwin installed. + +The instructions are: + +1. Download cygwin (www.cygwin.com) and use the setup program + to install packages for gcc, gcc-mingw, w32api, make, cvs, + python, and perl (and maybe others... the dependency list + is bound to change over time and hopefully these instructions + will keep with the changes). All of the following + commands will be entered at the cygwin prompt so launch + cygwin now. + +2. Create a directory to put your sources and then enter that + directory, e.g.: + mkdir bf-blender + cd bf-blender + +3. checkout the blender module from the bf-blender tree using cvs + (use password anonymous): + cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login + cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender \ + co blender + +4. checkout the lib/windows module from bf-blender using cvs: + cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender \ + co lib/windows + +5. Enter the newly created blender directory: + cd blender + +6. to prepare the build system to use only the free tools we must + set some environment variables. This is done by creating a + file called "user-def.mk" in the blender directory and + inserting the following line with notepad or your favorite + text editor: + export FREE_WINDOWS=true + + The quickest way to do this though is to issue the following + command: + echo 'export FREE_WINDOWS=true' > user-def.mk + +7. Time to build... issue the command: + make + +8. Wait for it to finish (there is this mysterious place called + 'outside' that I am told is nice to go to while waiting for a + compile to finish). + +Getting Help +------------ +If you have problems, come by #blendersauce on irc.freenode.net +or post questions to the "Compiling, Libraries, Modules" forum +at www.blender.org. There is also the very useful bf-committers +mailing list, what you can subscribe to here: + +http://www.blender.org/mailman/listinfo/bf-committers +(as a bonus you can get info about the most recent features that +are coming down the pipe ...) + +This said, the most common fix to a problem will +probably involve installing an additional cygwin package, +so keep that cygwin setup program close by ... + +Some final notes +---------------- + +- The build will take a long time, even on a fast machine + (a clean build takes almost an hour on my Athlon 1800+ + based laptop). +- If the build is successful you will find it has created + the program obj/windows/bin/blender.exe +- Sound is disabled +- If you want to clean your sources issue a 'make clean' + in the top blender directory. +- If you want to update your sources when somebody has + added a new awesome feature, you will want to go to the + topmost blender directory and issue the following command: + cvs -z3 update -P -d + It would probably be best to clean your sources before + re-building (see previous note). +- This is a work in progress, so some things may not be working + right or it may not support all of the cutting edge features. +- Want to make a fancy zipped up blender package to give + to your buddies? Try "make release" ... read the output + to find out where the zip file was placed (note: you will + probably need the zip/unzip packages from cygwin to do + this) diff --git a/intern/SoundSystem/SND_DependKludge.h b/intern/SoundSystem/SND_DependKludge.h index e924df5889b..df30f46b582 100644 --- a/intern/SoundSystem/SND_DependKludge.h +++ b/intern/SoundSystem/SND_DependKludge.h @@ -34,7 +34,7 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ -#if defined (_WIN32) +# if defined (_WIN32) && !defined(FREE_WINDOWS) #define USE_OPENAL #elif defined (__linux__) # if defined (__i386__) diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index a7c89c7e0a6..f4649a9574b 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -39,7 +39,7 @@ typedef unsigned short GHOST_TUns16; typedef int GHOST_TInt32; typedef unsigned int GHOST_TUns32; -#ifdef WIN32 +#if defined(WIN32) && !defined(FREE_WINDOWS) typedef __int64 GHOST_TInt64; typedef unsigned __int64 GHOST_TUns64; #else diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp index 0e5e82f1f11..3fbacfb1db8 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp +++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp @@ -47,7 +47,9 @@ // We do not support multiple monitors at the moment #include <windows.h> #define COMPILE_MULTIMON_STUBS +#ifndef FREE_WINDOWS #include <multimon.h> +#endif GHOST_DisplayManagerWin32::GHOST_DisplayManagerWin32(void) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 3d9943a5c8c..d1242198d4e 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -317,7 +317,11 @@ GHOST_TSuccess GHOST_SystemWin32::init() wc.cbClsExtra= 0; wc.cbWndExtra= 0; wc.hInstance= ::GetModuleHandle(0); - wc.hIcon = ::LoadIcon(wc.hInstance, "APPICON"); + #ifndef FREE_WINDOWS + wc.hIcon = ::LoadIcon(wc.hInstance, "APPICON"); + #else + wc.hIcon = ::LoadIcon(NULL, "APPICON"); + #endif if (!wc.hIcon) { ::LoadIcon(NULL, IDI_APPLICATION); } @@ -466,6 +470,7 @@ GHOST_EventCursor* GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type, { GHOST_TInt32 x, y; getSystem()->getCursorPosition(x, y); + printf("%d %d\n",x,y); return new GHOST_EventCursor (getSystem()->getMilliSeconds(), type, window, x, y); } diff --git a/intern/keymaker/Makefile b/intern/keymaker/Makefile index 038dd85fc7e..703482a851b 100644 --- a/intern/keymaker/Makefile +++ b/intern/keymaker/Makefile @@ -51,8 +51,12 @@ LOADER_OBJS = $(DIR)/$(DEBUG_DIR)keyloader.o ifneq ($(OS),windows) LIBS = $(NAN_OPENSSL)/lib/libcrypto.a else - LIBS = $(NAN_OPENSSL)/lib/libeay32.lib - LIBS += advapi32.lib gdi32.lib + ifeq ($(FREE_WINDOWS),true) + LIBS = $(NAN_OPENSSL)/lib/libcrypto.a + else + LIBS = $(NAN_OPENSSL)/lib/libeay32.lib + LIBS += advapi32.lib gdi32.lib + endif endif all debug:: link diff --git a/intern/python/freeze/Makefile b/intern/python/freeze/Makefile index a9e363cb687..893f6493a11 100644 --- a/intern/python/freeze/Makefile +++ b/intern/python/freeze/Makefile @@ -8,6 +8,10 @@ SRCDIR = ../modules TARGETDIR = $(OCGDIR)/blender/bpython/frozen +ifeq ($(FREE_WINDOWS),true) + export NAN_PYTHON_BINARY = python +endif + PYFLAGS=-S -O default: importer @@ -18,7 +22,15 @@ all debug: default install: importer importer: +ifeq ($(FREE_WINDOWS),true) + cp $(NAN_PYTHON)/lib/python22.dll . + dlltool.exe -v --output-lib $(NAN_PYTHON)/lib/freepy.a \ + --input-def $(NANBLENDERHOME)/dlltool/python.def \ + --dllname python22.dll + ranlib $(NAN_PYTHON)/lib/freepy.a + rm ./python22.dll @[ -d $(TARGETDIR) ] || mkdir -p $(TARGETDIR) +endif $(NAN_PYTHON_BINARY) $(PYFLAGS) freeze.py -d -x os -x pprint -x string -x copy -I $(SRCDIR) -o $(TARGETDIR) $(SRCDIR)/VRMLmain.py $(MAKE) -C $(TARGETDIR) diff --git a/intern/python/freeze/makemakefile.py b/intern/python/freeze/makemakefile.py index 0e97ad81147..c13689304b7 100644 --- a/intern/python/freeze/makemakefile.py +++ b/intern/python/freeze/makemakefile.py @@ -25,11 +25,15 @@ def makemakefile(outfp, makevars, files, target): for key in keys: outfp.write("%s=%s\n" % (key, makevars[key])) - outfp.write("\n\ninclude nan_definitions.mk\n") - outfp.write("ifeq ($(OS),windows)\n") - outfp.write(" CC=$(NANBLENDERHOME)/source/tools/cygwin/cl_wrapper.pl\n") - outfp.write(" CFLAGS=-I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) $(OPT)\n") - outfp.write("endif\n") + outfp.write("\n\ninclude nan_definitions.mk\n") + outfp.write("ifeq ($(OS),windows)\n") + outfp.write(" CFLAGS=-I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) $(OPT)\n") + outfp.write(" ifneq ($(FREE_WINDOWS),true)\n") + outfp.write(" CC=$(NANBLENDERHOME)/source/tools/cygwin/cl_wrapper.pl\n") + outfp.write(" else\n") + outfp.write(" CFLAGS += -mwindows -mno-cygwin\n") + outfp.write(" endif\n") + outfp.write("endif\n") outfp.write("\nall: %s\n\n" % libtarget) diff --git a/source/Makefile b/source/Makefile index eb7b5a9300a..1e6ac83ae1d 100644 --- a/source/Makefile +++ b/source/Makefile @@ -138,7 +138,11 @@ PYPLAYERLIB ?= $(PYLIB) endif ifeq ($(WITH_FREETYPE2), true) ifeq ($(OS), windows) - COMLIB += $(NAN_FREETYPE)/lib/freetype2ST.lib + ifeq ($(FREE_WINDOWS), true) + COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a + else + COMLIB += $(NAN_FREETYPE)/lib/freetype2ST.lib + endif else ifeq ($(OS), irix) COMLIB += $(NAN_FREETYPE)/lib32/libfreetype.a @@ -153,8 +157,7 @@ ifeq ($(INTERNATIONAL), true) ifeq ($(FREE_WINDOWS), true) COMLIB += $(NAN_GETTEXT)/lib/freegettext.a COMLIB += $(NAN_FTGL)/lib/libftgl.a - COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a - COMLIB += $(NAN_ICONV)/lib/freeiconv.a + #COMLIB += $(NAN_ICONV)/lib/freeiconv.a else COMLIB += $(NAN_GETTEXT)/lib/gnu_gettext.lib COMLIB += $(NAN_FTGL)/lib/ftgl_static_ST.lib @@ -211,13 +214,18 @@ endif PULIB += $(NAN_BLENKEY)/lib/libblenkey.a SPLIB += $(NAN_BLENKEY)/lib/libblenkey.a - ifeq ($(OS),windows) - PULIB += $(NAN_OPENSSL)/lib/libeay32.lib - SPLIB += $(NAN_OPENSSL)/lib/libeay32.lib - else - PULIB += $(NAN_OPENSSL)/lib/libcrypto.a - SPLIB += $(NAN_OPENSSL)/lib/libcrypto.a - endif + ifeq ($(OS),windows) + ifeq ($(FREE_WINDOWS),true) + PULIB += $(NAN_OPENSSL)/lib/libcrypto.a + SPLIB += $(NAN_OPENSSL)/lib/libcrypto.a + else + PULIB += $(NAN_OPENSSL)/lib/libeay32.lib + SPLIB += $(NAN_OPENSSL)/lib/libeay32.lib + endif + else + PULIB += $(NAN_OPENSSL)/lib/libcrypto.a + SPLIB += $(NAN_OPENSSL)/lib/libcrypto.a + endif # These three need to be explicitly mentioned on the cl, because # if they are offered as a lib, they are optimized away. (nzc) @@ -395,7 +403,12 @@ else endif ifeq ($(OS),windows) - PYLIB = $(NAN_PYTHON)/lib/python22.lib + ifeq ($(FREE_WINDOWS),true) + PYLIB = $(NAN_PYTHON)/lib/freepy.a + else + PYLIB = $(NAN_PYTHON)/lib/python22.lib + endif + PYPLAYERLIB = $(NAN_PYTHON)/static/*.obj PYPLAYERLIB = $(PYLIB) @@ -403,9 +416,11 @@ ifeq ($(OS),windows) NSPLUGLIB += $(NAN_NSPR)/lib/nspr4.lib BINTARGETS = blenderdynamic - BINTARGETS += blenderplayer - BINTARGETS += blenderdynplayer - BINTARGETS += plugin + ifneq ($(FREE_WINDOWS),true) + BINTARGETS += blenderplayer + BINTARGETS += blenderdynplayer + BINTARGETS += plugin + endif PULIB += $(OCGDIR)/blender/icons/$(DEBUG_DIR)winblender.res PULIB += $(NAN_ZLIB)/lib/libz.a @@ -513,7 +528,9 @@ ifeq ($(OS),$(findstring $(OS), "freebsd linux irix solaris")) endif # Windows needs a 8.3 name... Why? Dunno... ifeq ($(OS),windows) - plugin: $(DIR)/$(DEBUG_DIR)npB3DPlg$(SOEXT) + ifneq ($(FREE_WINDOWS),true) + plugin: $(DIR)/$(DEBUG_DIR)npB3DPlg$(SOEXT) + endif endif $(DIR)/$(DEBUG_DIR)blenderstatic: $(OBJS) $(GRPLIB) $(COMLIB) $(PULIB) diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h index 2b756e26f5b..825a8bc9cbd 100644 --- a/source/blender/blenlib/BLI_storage_types.h +++ b/source/blender/blenlib/BLI_storage_types.h @@ -48,7 +48,7 @@ struct header{ char fill[HDRSIZE-NAMSIZE-2*sizeof(unsigned int)]; }; -#ifdef WIN32 +#if defined(WIN32) && !defined(FREE_WINDOWS) typedef unsigned int mode_t; #endif diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index b09fcbafa8c..b9f92aedb98 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -69,7 +69,9 @@ #define S_ISDIR(x) ((x&S_IFMT) == S_IFDIR) #endif +#ifndef FREE_WINDOWS typedef unsigned int mode_t; +#endif struct dirent { int d_ino; @@ -91,8 +93,10 @@ typedef struct _DIR { } DIR; void RegisterBlendExtension(char * str); +#ifndef FREE_WINDOWS int strcasecmp (char *s1, char *s2); int strncasecmp (char *s1, char *s2, int n); +#endif DIR *opendir (const char *path); struct dirent *readdir(DIR *dp); int closedir (DIR *dp); diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index e7c9ec1c864..1166932019a 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -36,7 +36,7 @@ #include <config.h> #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(FREE_WINDOWS) typedef unsigned __int64 r_uint64; #else typedef unsigned long long r_uint64; diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 2a69bf0b1e5..3a4491dedaa 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -134,6 +134,7 @@ static void strnlower (char *str, int n) { } } +#ifndef FREE_WINDOWS int strcasecmp (char *s1, char *s2) { char *st1, *st2; int r; @@ -174,6 +175,7 @@ int strncasecmp (char *s1, char *s2, int n) { return r; } +#endif DIR *opendir (const char *path) { if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY) { diff --git a/source/blender/blenloader/intern/genfile.c b/source/blender/blenloader/intern/genfile.c index f985879de32..ea7f6dc2985 100644 --- a/source/blender/blenloader/intern/genfile.c +++ b/source/blender/blenloader/intern/genfile.c @@ -61,6 +61,9 @@ #include "genfile.h" +#ifdef FREE_WINDOWS +typedef long long __int64; +#endif /* * - please note: no builtin security to detect input of double structs diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 609b99b9f15..5b5632401ba 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -498,7 +498,7 @@ static void switch_endian_bh8(BHead8 *bhead) static void bh4_from_bh8(BHead *bhead, BHead8 *bhead8, int do_endian_swap) { BHead4 *bhead4 = (BHead4 *) bhead; -#ifdef WIN32 +#if defined(WIN32) && !defined(FREE_WINDOWS) __int64 old; #else long long old; @@ -1052,7 +1052,7 @@ static void link_glob_list(FileData *fd, ListBase *lb) /* for glob data */ static void test_pointer_array(FileData *fd, void **mat) { -#ifdef WIN32 +#if defined(WIN32) && !defined(FREE_WINDOWS) __int64 *lpoin, *lmat; #else long long *lpoin, *lmat; diff --git a/source/blender/decrypt/BLO_en_de_cryptHeader.h b/source/blender/decrypt/BLO_en_de_cryptHeader.h index fd9f634c27e..a555e66e800 100644 --- a/source/blender/decrypt/BLO_en_de_cryptHeader.h +++ b/source/blender/decrypt/BLO_en_de_cryptHeader.h @@ -40,6 +40,10 @@ extern "C" { #include "BLO_sys_types.h" +#ifdef FREE_WINDOWS +typedef int int32_t; +#endif + #define EN_DE_CRYPTHEADERSTRUCTSIZE sizeof(struct BLO_en_de_cryptHeaderStruct) // Tests showed: pubKeyLen 64, cryptedKeyLen 64 bytes diff --git a/source/blender/encrypt/intern/BLO_encrypt.c b/source/blender/encrypt/intern/BLO_encrypt.c index ce44baf5e22..3353a1fd69f 100644 --- a/source/blender/encrypt/intern/BLO_encrypt.c +++ b/source/blender/encrypt/intern/BLO_encrypt.c @@ -91,8 +91,10 @@ BLO_encrypt( } #ifdef _WIN32 +#ifndef FREE_WINDOWS RAND_screen(); #endif +#endif RAND_bytes(cryptKey, cryptKeyLen); RC4_set_key(rc4_key, cryptKeyLen, cryptKey); diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h index cdc0c33fb42..8553a3868d1 100644 --- a/source/blender/makesdna/DNA_sdna_types.h +++ b/source/blender/makesdna/DNA_sdna_types.h @@ -70,7 +70,7 @@ typedef struct BHead4 { # typedef struct BHead8 { int code, len; -#ifdef WIN32 +#if defined(WIN32) && !defined(FREE_WINDOWS) /* This is a compiler type! */ __int64 old; #else diff --git a/source/blender/makesdna/intern/Makefile b/source/blender/makesdna/intern/Makefile index d6a762156ca..84d854064d7 100644 --- a/source/blender/makesdna/intern/Makefile +++ b/source/blender/makesdna/intern/Makefile @@ -54,10 +54,14 @@ ifeq ($(OS),windows) # _really_ needed, but it is the easiest fix for now. If you have # some spare time, try to trace down the exact dep. Then again, you # could also spend that time making the sdna system more robust. - WINLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib - WINLIBS += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib - WINLIBS += winmm.lib opengl32.lib glu32.lib largeint.lib - WINLIBS += /link /nodefaultlib:libc + ifneq ($(FREE_WINDOWS),true) + WINLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib + WINLIBS += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib + WINLIBS += winmm.lib opengl32.lib glu32.lib largeint.lib + WINLIBS += /link /nodefaultlib:libc + else + LDFLAGS += -mwindows -mno-cygwin + endif endif clean:: diff --git a/source/blender/readstreamglue/BLO_sys_types.h b/source/blender/readstreamglue/BLO_sys_types.h index 4333f74465d..38dde20500e 100644 --- a/source/blender/readstreamglue/BLO_sys_types.h +++ b/source/blender/readstreamglue/BLO_sys_types.h @@ -47,7 +47,12 @@ extern "C" { #endif -#ifdef _WIN32 +#ifdef FREE_WINDOWS +typedef unsigned char uint8_t; +typedef unsigned int uint32_t; +#endif + +#if defined(_WIN32) && !defined(FREE_WINDOWS) /* The __intXX are built-in types of the visual complier! So we don't * need to include anything else here. */ diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 4aa8d5cf02d..bd331aa44d8 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -1260,7 +1260,7 @@ void RE_animrender(struct View3D *ogl_render_view3d) } else if (R.r.imtype==R_MOVIE) { start_movie(); #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(FREE_WINDOWS) } else if (R.r.imtype == R_AVICODEC) { start_avi_codec(); #endif @@ -1290,7 +1290,7 @@ void RE_animrender(struct View3D *ogl_render_view3d) } else if (R.r.imtype == R_MOVIE) { append_movie((G.scene->r.cfra)); #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(FREE_WINDOWS) } else if (R.r.imtype == R_AVICODEC) { append_avi_codec((G.scene->r.cfra)); #endif @@ -1330,7 +1330,7 @@ void RE_animrender(struct View3D *ogl_render_view3d) } else if (R.r.imtype==R_MOVIE) { end_movie(); #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(FREE_WINDOWS) } else if (R.r.imtype == R_AVICODEC) { end_avi_codec(); #endif diff --git a/source/blender/src/writeavicodec.c b/source/blender/src/writeavicodec.c index b729b1d944d..1b6a9776515 100644 --- a/source/blender/src/writeavicodec.c +++ b/source/blender/src/writeavicodec.c @@ -37,7 +37,7 @@ #include <config.h> #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(FREE_WINDOWS) #define INC_OLE2 #include <windows.h> diff --git a/source/blender/verify/BLO_sign_verify_Header.h b/source/blender/verify/BLO_sign_verify_Header.h index 8f26eed95aa..d2290dc4ad7 100644 --- a/source/blender/verify/BLO_sign_verify_Header.h +++ b/source/blender/verify/BLO_sign_verify_Header.h @@ -38,6 +38,10 @@ extern "C" { #endif +#ifdef FREE_WINDOWS +typedef int int32_t; +#endif + #include "BLO_sys_types.h" #define SIGNVERIFYHEADERSTRUCTSIZE sizeof(struct BLO_sign_verify_HeaderStruct) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h index 24cd17415ac..02bae96d840 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h @@ -36,11 +36,16 @@ #pragma warning(disable : 4786) // shut off 255 char limit debug template warning #endif +#include <map> + /* need to be here for conversion purposes */ +#ifdef FREE_WINDOWS +#undef HKEY +#endif + #include "mydevice.h" #include "SCA_IInputDevice.h" -#include <map> /** Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode. */ diff --git a/source/gameengine/GamePlayer/Makefile b/source/gameengine/GamePlayer/Makefile index 49f47a4d4a0..fab44ad9bc7 100644 --- a/source/gameengine/GamePlayer/Makefile +++ b/source/gameengine/GamePlayer/Makefile @@ -38,7 +38,9 @@ DIR = $(OCGDIR)/gameengine/GamePlayer DIRS = common ghost ifeq ($(OS),$(findstring $(OS), "freebsd irix windows")) - DIRS += netscape + ifneq ($(FREE_WINDOWS),true) + DIRS += netscape + endif endif ifeq ($(OS),$(findstring $(OS), "linux")) diff --git a/source/nan_compile.mk b/source/nan_compile.mk index df0fa368446..f023d43402e 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -174,28 +174,47 @@ ifeq ($(OS),solaris) endif ifeq ($(OS),windows) - CC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl - CCC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl - JAVAC = $(SRCHOME)/tools/cygwin/java_wrapper.pl -c - JAVAH = $(SRCHOME)/tools/cygwin/java_wrapper.pl -h - REL_CFLAGS += /O2 - REL_CCFLAGS += /O2 -GX - DBG_CFLAGS += /Fd$(DIR)/debug/ - DBG_CCFLAGS += /Fd$(DIR)/debug/ - CFLAGS += /MT - CCFLAGS += /MT - NAN_DEPEND = true - OPENGL_HEADERS = . - CPPFLAGS += -DWIN32 -D_WIN32 -D__WIN32 - CPPFLAGS += -D_M_IX86 - CPPFLAGS += -I"/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/include" - JAVA_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include - JAVA_SYSTEM_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include/win32 - CPP = $(SRCHOME)/tools/cygwin/cl_wrapper.pl - AR = ar - ARFLAGS = ruv - ARFLAGSQUIET = ru - WINRC = $(wildcard *.rc) + ifeq ($(FREE_WINDOWS),true) + CC = gcc + CCC = g++ + CFLAGS += -pipe -mno-cygwin -mwindows + CCFLAGS += -pipe -mno-cygwin -mwindows + CPPFLAGS += -DFREE_WINDOWS + #CPPFLAGS += -I/usr/include/mingw + REL_CFLAGS += -O2 + REL_CCFLAGS += -O2 + #NAN_DEPEND = true + #OPENGL_HEADERS = /usr/include/w32api + OPENGL_HEADERS = ./ + AR = ar + ARFLAGS = ruv + ARFLAGSQUIET = ru + WINRC = $(wildcard *.rc) + RANLIB = ranlib + else + CC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl + CCC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl + JAVAC = $(SRCHOME)/tools/cygwin/java_wrapper.pl -c + JAVAH = $(SRCHOME)/tools/cygwin/java_wrapper.pl -h + REL_CFLAGS += /O2 + REL_CCFLAGS += /O2 -GX + DBG_CFLAGS += /Fd$(DIR)/debug/ + DBG_CCFLAGS += /Fd$(DIR)/debug/ + CFLAGS += /MT + CCFLAGS += /MT + NAN_DEPEND = true + OPENGL_HEADERS = . + CPPFLAGS += -DWIN32 -D_WIN32 -D__WIN32 + CPPFLAGS += -D_M_IX86 + CPPFLAGS += -I"/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/include" + JAVA_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include + JAVA_SYSTEM_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include/win32 + CPP = $(SRCHOME)/tools/cygwin/cl_wrapper.pl + AR = ar + ARFLAGS = ruv + ARFLAGSQUIET = ru + WINRC = $(wildcard *.rc) + endif endif ifeq (debug, $(findstring debug, $(MAKECMDGOALS))) @@ -245,8 +264,15 @@ $(DIR)/$(DEBUG_DIR)%.o: %.cpp $(CCC) -c $(CCFLAGS) $(CPPFLAGS) $< -o $@ endif +#$(DIR)/$(DEBUG_DIR)%.res: %.rc +# $(SRCHOME)/tools/cygwin/cl_wrapper.pl - rc /fo$@ $< + $(DIR)/$(DEBUG_DIR)%.res: %.rc +ifeq ($(FREE_WINDOWS),true) + windres $< -O coff -o $@ +else $(SRCHOME)/tools/cygwin/cl_wrapper.pl - rc /fo$@ $< +endif $(DIR)/$(DEBUG_DIR)%.class: %.java ifdef JARS diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index 442660dd3f0..401e09752c8 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -74,7 +74,11 @@ all debug:: export NAN_GHOST ?= $(LCGDIR)/ghost export NAN_TEST_VERBOSITY ?= 1 export NAN_BMFONT ?= $(LCGDIR)/bmfont - export NAN_FTGL ?= $(LCGDIR)/ftgl + ifeq ($(FREE_WINDOWS), true) + export NAN_FTGL ?= $(LCGDIR)/gcc/ftgl + else + export NAN_FTGL ?= $(LCGDIR)/ftgl + endif # Platform Dependent settings go below: @@ -379,7 +383,17 @@ all debug:: export NAN_PYTHON ?= $(LCGDIR)/python export NAN_ICONV ?= $(LCGDIR)/iconv export NAN_PYTHON_VERSION ?= 2.2 - export NAN_PYTHON_BINARY ?= python + ifeq ($(FREE_WINDOWS), true) + export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) + export NAN_OPENSSL ?= $(LCGDIR)/gcc/openssl + export NAN_FREETYPE ?= $(LCGDIR)/gcc/freetype + export NAN_ODE ?= $(LCGDIR)/gcc/ode + else + export NAN_PYTHON_BINARY ?= python + export NAN_OPENSSL ?= $(LCGDIR)/openssl + export NAN_FREETYPE ?= $(LCGDIR)/freetype + export NAN_ODE ?= $(LCGDIR)/ode + endif export NAN_MXTEXTTOOLS ?= $(shell $(NAN_PYTHON_BINARY) -c \ 'import mx; print mx.__path__[0]')/TextTools/mxTextTools/mxTextTools.so export NAN_OPENAL ?= $(LCGDIR)/openal @@ -387,13 +401,10 @@ all debug:: export NAN_JPEG ?= $(LCGDIR)/jpeg export NAN_PNG ?= $(LCGDIR)/png export NAN_SDL ?= $(LCGDIR)/sdl - export NAN_ODE ?= $(LCGDIR)/ode - export NAN_OPENSSL ?= $(LCGDIR)/openssl export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay export NAN_MESA ?= /usr/src/Mesa-3.1 export NAN_ZLIB ?= $(LCGDIR)/zlib export NAN_NSPR ?= $(LCGDIR)/nspr - export NAN_FREETYPE ?= $(LCGDIR)/freetype export NAN_GETTEXT ?= $(LCGDIR)/gettext # Uncomment the following line to use Mozilla inplace of netscape @@ -403,7 +414,7 @@ all debug:: export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/ # Will fall back to look in NAN_MOZILLA_INC/nspr and NAN_MOZILLA_LIB # if this is not set. - +export NAN_PYTHON_BINARY ?= python export NAN_BUILDINFO ?= true # Be paranoid regarding library creation (do not update archives) export NAN_PARANOID ?= true @@ -421,7 +432,7 @@ all debug:: export NAN_PYTHON ?= $(LCGDIR)/python export NAN_PYTHON_VERSION ?= 2.0 - export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) + export NAN_PYTHON_BINARY ?= python export NAN_MXTEXTTOOLS ?= $(shell $(NAN_PYTHON_BINARY) -c \ 'import mx; print mx.__path__[0]')/TextTools/mxTextTools/mxTextTools.so export NAN_OPENAL ?= $(LCGDIR)/openal diff --git a/source/nan_link.mk b/source/nan_link.mk index 1006bf6d9dd..88d2c12ebd8 100644 --- a/source/nan_link.mk +++ b/source/nan_link.mk @@ -59,7 +59,7 @@ ifeq ($(OS),darwin) LLIBS += -lGLU -lGL LLIBS += -lz -framework Carbon -framework AGL ifeq ($(WITH_QUICKTIME), true) - LLIBS += -framework QuickTime + LLIBS += -framework QuickTime endif LDFLAGS += -L/System/Library/Frameworks/OpenGL.framework/Libraries DBG_LDFLAGS += -L/System/Library/Frameworks/OpenGL.framework/Libraries @@ -124,19 +124,26 @@ endif ifeq ($(OS),windows) EXT = .exe SOEXT = .dll - DADD = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib - DADD += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib - DADD += vfw32.lib winmm.lib opengl32.lib glu32.lib largeint.lib dxguid.lib - DADD += libcmt.lib - LOPTS = /link - LOPTS += /NODEFAULTLIB:"libc" - LOPTS += /NODEFAULTLIB:"libcd" - LOPTS += /NODEFAULTLIB:"libcp" - LOPTS += /NODEFAULTLIB:"libcpd" - LOPTS += /NODEFAULTLIB:"python20" - LOPTS += /NODEFAULTLIB:"msvcrt" - LOPTS += /SUBSYSTEM:CONSOLE - LDFLAGS += /MT - DYNLDFLAGS = /LD + ifeq ($(FREE_WINDOWS),true) + MINGWLIB = /usr/lib/w32api + LDFLAGS += -mwindows -mno-cygwin -mconsole + DADD += -L/usr/lib/w32api -lnetapi32 -lopengl32 -lglu32 + DADD += -L/usr/lib/w32api + else + DADD = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib + DADD += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib + DADD += vfw32.lib winmm.lib opengl32.lib glu32.lib largeint.lib dxguid.lib + DADD += libcmt.lib + LOPTS = /link + LOPTS += /NODEFAULTLIB:"libc" + LOPTS += /NODEFAULTLIB:"libcd" + LOPTS += /NODEFAULTLIB:"libcp" + LOPTS += /NODEFAULTLIB:"libcpd" + LOPTS += /NODEFAULTLIB:"python20" + LOPTS += /NODEFAULTLIB:"msvcrt" + LOPTS += /SUBSYSTEM:CONSOLE + LDFLAGS += /MT + DYNLDFLAGS = /LD + endif endif |