[Bf-committers] Compiling under Windows with MinGW

sh484090 at 12move.nl sh484090 at 12move.nl
Sat Oct 23 02:37:33 CEST 2004


> From: Jeremy Wall <zaphar at gmail.com>
> I had this exact same problem myself on mingw but was never able to
> resolve it. I'd be interested in whether someone else manages it.

Hi,

I've been able to compile under MinGW for some time now. I currently use
mingw with a standard msys1.0.10 setup and GCC 3.4 under Win98SE. I apply
the following to get things to work, starting from a clear source tree.

1) Add "user-def.mk" file to bf-blender/blender with following lines:
    export FREE_WINDOWS=true
    export NAN_NO_KETSJI=true
    export OS=windows
Obviously, I don't use the game engine, hence line 2. See point 2) below
for the last line.

2) In bf-blender/source/blender/nan-definitions.mk replace
    export OS := $(shell echo ${CONFIG_GUESS} | sed -e 's/-.*//')
by
    export OS ?= $(shell echo ${CONFIG_GUESS} | sed -e 's/-.*//')
The question mark allows this line to be pre-empted by the "export
OS=windows" line in user-def.mk
Reason for this patch is that guessconfig on msys returns "mingw-32-i386"
and
we need "OS=windows".
Note: I haven't gone down a path to attempt to replace all "mingw-32-i386"

by "windows". Also see point 7) below on the library path.

3) In bf-blender/source/blender/makesdna/intern/Makefile: under target DNA.c
ensure that "makesdna" is called and not "cl_wrapper.pl" e.g.:

$(DIR)/$(DEBUG_DIR)DNA.c: $(DIR)/$(DEBUG_DIR)makesdna
     $(DIR)/$(DEBUG_DIR)makesdna $(DIR)/$(DEBUG_DIR)DNA.c

The cl_wrapper perl script generates a VC++ style compiler call 
(which we don't need) to build DNA.o  (and I don't have perl anyway).
"makesdna" works fine for me.

4) In bf-blender/source/blender/blenlib/intern/Makefile: removed spurious
/
at end of line
    CPPFLAGS += -I../../include/
GCC doesn't seem to like the trailing slash and fails to find include files
in this path if you leave it in

5) Same in bf-blender/source/blender/blenloader/intern/Makefile: removed
spurious / at end of line
    CPPFLAGS += -I../../render/extern/include/
GCC doesn't seem to like the trailing slash and fails to find include files
in this path if you leave it in


6) In bf-blender/source/blender/creator/buildinfo.c: ensure the
winbuildinfo.h file is not include. I apply the following hack (VERY
quick-and-dirty and not a real solution)
#ifdef WIN32                                    /* RF20040603: was ifndef
;
force use of symbols */
char * build_date=BUILD_DATE;
char * build_time=BUILD_TIME;
char * build_platform=BUILD_PLATFORM;
char * build_type=BUILD_TYPE;
#else
#include "winbuildinfo.h"
#endif

The reason for this is that the buildinfo.h file is only generated by the
SConstruct file under windows (this is an incompatibility between the SCons
build and the make build). The other method, creating date-time stamp using
symbols passed to the compiler works well under gcc/mingw.

7) Ensure you have a folder "bf-blender/lib/mingw-32-i386" which has all
the
contents of "bf-blender/lib/windows" in it (can be downloaded from cvs or
from the tarballs if you don't have it).

8) I don't seem to have "msgfmt" on my computer so for now I patch
bf-blender/blender/Makefile as follows:
    ifeq ($(FREE_WINDOWS),true)
        # RF20040610: Removed 'po' since msgfmt not available
        DIRS ?= dlltool extern intern source
    endif
The language files are already available so this is not a big deal.

The executable can be found in bf-blender/blender/obj/mingw-32-i386/bin.
Copy it to a blender folder which has all the other blender files (.blender
folder, dlls for python, open al etc.) before executing.

I haven't taken the time to come up with a fully consistent solution (e.g.
one that could be commited), so I don't necessarily advocate the
above, but it is very quick to apply and it works for me.

Hope this is useful.

Ray F


_____________________________________________________________________

12move ADSL nu de eerste maand voor maar ? 8,95! GRATIS modem, 
GEEN aansluitkosten en GEEN datalimiet! Ga nu naar http://adsl.12move.nl





More information about the Bf-committers mailing list