From 36a4af22c38fae7eb5b6099215b4fd003d7573a5 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 13 Mar 2006 11:42:49 +0000 Subject: ==SCons== * These changes bring cross-compiling Blender for Windows on Linux one step closer to reality. The 'biggest' change is in makesdna SConscript to make sure a linux native makesdna is built, that can be run, too. Next to that proper checks for env['OURPLATFORM']=='linuxcross' are added in various places. Switch change in pluginapi.c was necessary, and AFAIK it should work like that also on WIN32, if not, slap me. Note: everything *compiles* now nicely, it is just that the final *linking* doesn't work (yet). Anyone who fixes this will be the hero of cross-compilers :) --- source/blender/makesdna/intern/SConscript | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna/intern/SConscript') diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index dab0625f50e..706e57c206d 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -7,7 +7,7 @@ cflags = '' defines = [] root_build_dir=env['BF_BUILDDIR'] -source_files = ['makesdna.c'] +source_files = ['makesdna.c', '#intern/guardedalloc/intern/mallocn.c'] makesdna_tool = env.Copy() dna = env.Copy() @@ -16,16 +16,24 @@ makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ' makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc', '../../makesdna']) +if env['OURPLATFORM'] == 'linuxcross': + makesdna_tool.Replace(CC='gcc') + makesdna_tool.Replace(AR='ar') + makesdna_tool.Replace(LINK='gcc') + if sys.platform != 'cygwin': makesdna_tool.Append (CCFLAGS = cflags) makesdna_tool.Append (CPPDEFINES = defines) makesdna_tool.Append (LIBPATH = '#'+root_build_dir+'/lib') -makesdna_tool.Append (LIBS = 'bf_guardedalloc') + makesdna_tool.Program (target = '#'+root_build_dir+os.sep+'makesdna', source = source_files) dna_dict = dna.Dictionary() makesdna_name = root_build_dir+'/makesdna' + dna_dict['PROGSUFFIX'] dna.Depends ('dna.c', '#'+makesdna_name) -dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET") +if env['OURPLATFORM'] != 'linuxcross': + dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET") +else: + dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET") obj = 'intern/dna.c' Return ('obj') -- cgit v1.2.3