Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTom Musgrove <LetterRip@gmail.com>2010-02-01 21:39:41 +0300
committerTom Musgrove <LetterRip@gmail.com>2010-02-01 21:39:41 +0300
commitf2a8bb34989204dbdfee39cc6279808b5d5a8c9a (patch)
treedf7bfbcac23d77e1d38c5c9a70ff9740c0028aec /tools
parent7fe3ab7e8e23fb8750eead8f53802928b734821c (diff)
this restores building on mingw with Collada support, also it restores cross compiling, thanks to Sergey Sharybin for the patch. Note that the icons for linux cross might not be committed here, if not i'll add them in another commit
Diffstat (limited to 'tools')
-rw-r--r--tools/Blender.py18
-rw-r--r--tools/btools.py6
-rw-r--r--tools/crossmingw.py98
3 files changed, 65 insertions, 57 deletions
diff --git a/tools/Blender.py b/tools/Blender.py
index c51c1367f33..441d454b782 100644
--- a/tools/Blender.py
+++ b/tools/Blender.py
@@ -117,15 +117,19 @@ def setup_staticlibs(lenv):
statlibs = [
#here libs for static linking
]
- libincs = [
- '/usr/lib',
+
+ libincs = []
+ if lenv['OURPLATFORM'] != 'linuxcross':
+ libincs.append('/usr/lib')
+
+ libincs.extend([
lenv['BF_OPENGL_LIBPATH'],
lenv['BF_JPEG_LIBPATH'],
lenv['BF_PNG_LIBPATH'],
lenv['BF_ZLIB_LIBPATH'],
lenv['BF_LIBSAMPLERATE_LIBPATH'],
lenv['BF_ICONV_LIBPATH']
- ]
+ ])
libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
if lenv['WITH_BF_PYTHON']:
@@ -167,6 +171,10 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_PCRE_LIBPATH'])
libincs += Split(lenv['BF_EXPAT_LIBPATH'])
+ if lenv['WITH_BF_OPENMP']:
+ if lenv['OURPLATFORM'] == 'linuxcross':
+ libincs += Split(lenv['BF_OPENMP_LIBPATH'])
+
return statlibs, libincs
@@ -752,11 +760,11 @@ class BlenderEnvironment(SConsEnvironment):
if lenv['OURPLATFORM']=='darwin':
lenv['BINARYKIND'] = binarykind
lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
- elif os.sep == '/': # any unix
+ elif os.sep == '/' and lenv['OURPLATFORM'] != 'linuxcross': # any unix (except cross-compilation)
if lenv['WITH_BF_PYTHON']:
if not lenv['WITHOUT_BF_INSTALL'] and not lenv['WITHOUT_BF_PYTHON_INSTALL']:
lenv.AddPostAction(prog,Action(UnixPyBundle,strfunction=my_unixpybundle_print))
- elif lenv['OURPLATFORM'].startswith('win'): # windows
+ elif lenv['OURPLATFORM'].startswith('win') or lenv['OURPLATFORM'] == 'linuxcross': # windows or cross-compilation
if lenv['WITH_BF_PYTHON']:
if not lenv['WITHOUT_BF_PYTHON_INSTALL']:
lenv.AddPostAction(prog,Action(WinPyBundle,strfunction=my_winpybundle_print))
diff --git a/tools/btools.py b/tools/btools.py
index 7dde9a14f6c..a8e39e3d100 100644
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -64,6 +64,9 @@ def validate_arguments(args, bc):
'WITHOUT_BF_INSTALL',
'WITHOUT_BF_PYTHON_INSTALL',
'WITH_BF_OPENMP',
+ 'BF_OPENMP',
+ 'BF_OPENMP_INC',
+ 'BF_OPENMP_LIBPATH',
'WITH_GHOST_COCOA',
'USE_QTKIT',
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
@@ -318,6 +321,9 @@ def read_opts(cfg, args):
('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
(BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)),
+ ('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''),
+ ('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''),
+ ('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''),
(BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', False)),
(BoolVariable('USE_QTKIT', 'Use QTKIT if true', False)),
diff --git a/tools/crossmingw.py b/tools/crossmingw.py
index 299bfca929d..ba6d4878593 100644
--- a/tools/crossmingw.py
+++ b/tools/crossmingw.py
@@ -1,7 +1,4 @@
-#coments are #JB where this file was altered by Jasen Betts
-# email: 'n@tres'.join(['jase','hna.com'])
-
-"""tools.crossmingw
+"""SCons.Tool.gcc
Tool-specific initialization for MinGW (http://www.mingw.org/)
@@ -12,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/Tool/mingw.py 0.96.91.D001 2005/09/08 09:14:36 knight"
+__revision__ = "src/engine/SCons/Tool/mingw.py 4043 2009/02/23 09:06:45 scons"
import os
import os.path
@@ -42,6 +39,7 @@ import string
import SCons.Action
import SCons.Builder
+import SCons.Defaults
import SCons.Tool
import SCons.Util
@@ -63,18 +61,20 @@ def find(env):
return ''
def shlib_generator(target, source, env, for_signature):
- cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])
+ cmd = SCons.Util.CLVar(['$SHLINK'])
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
if dll: cmd.extend(['-o', dll])
- cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
+ cmd.extend(['$SOURCES', '$SHLINKFLAGS', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
- def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
- if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
+ def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
+ insert_def = env.subst("$WINDOWS_INSERT_DEF")
+ if not insert_def in ['', '0', 0] and def_target: \
+ cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
return [cmd]
@@ -89,7 +89,7 @@ def shlib_emitter(target, source, env):
not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
# Append an import library to the list of targets.
- target.append(env.ReplaceIxes(dll,
+ target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
'LIBPREFIX', 'LIBSUFFIX'))
@@ -97,76 +97,64 @@ def shlib_emitter(target, source, env):
# or a def file source. There is no option to disable def file
# target emitting, because I can't figure out why someone would ever
# want to turn it off.
- def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
- def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+ def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
+ def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
if not def_source and not def_target:
- target.append(env.ReplaceIxes(dll,
+ target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
- 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX'))
+ 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX'))
return (target, source)
-#JB """ I'm blindly susbstuting lines from the mingw.py
-#JB file becase these lines cause python errors here. """
-#JB shlib_action = SCons.Action.Action(shlib_generator,generator=1)
-shlib_action = SCons.Action.CommandGeneratorAction(shlib_generator)
-
-res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
-#JB """ changed for what was in mingw.py """
-#JB res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
-#JB source_scanner=SCons.Tool.SourceFileScanner)
+shlib_action = SCons.Action.Action(shlib_generator, generator=1)
-res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o',
- source_scanner=SCons.Defaults.ObjSourceScan)
+res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
-#JB SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
-SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan)
-#JB """ no more changes """
+res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
+ source_scanner=SCons.Tool.SourceFileScanner)
+SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
def generate(env):
- mingw_prefix = find(env)
-
- if mingw_prefix:
- dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc'))
-
- # The mingw bin directory must be added to the path:
- path = env['ENV'].get('PATH', [])
- if not path:
- path = []
- if SCons.Util.is_String(path):
- path = string.split(path, os.pathsep)
-
- env['ENV']['PATH'] = string.join([dir] + path, os.pathsep)
+ mingw = find(env)
+ if mingw:
+ dir = os.path.dirname(mingw)
+ env.PrependENVPath('PATH', dir )
+
# Most of mingw is the same as gcc and friends...
- gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas']
+ gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'm4']
for tool in gnu_tools:
SCons.Tool.Tool(tool)(env)
#... but a few things differ:
- env['CC'] = mingw_prefix + 'gcc'
+ env['CC'] = mingw + 'gcc'
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
- env['CXX'] = mingw_prefix + 'g++'
+ env['CXX'] = mingw + 'g++'
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
env['SHLINKCOM'] = shlib_action
- env['AR'] = mingw_prefix + 'ar'
- env['RANLIB'] = mingw_prefix + 'ranlib'
+ env['LDMODULECOM'] = shlib_action
env.Append(SHLIBEMITTER = [shlib_emitter])
- env['LINK'] = mingw_prefix + 'gcc'
- env['AS'] = mingw_prefix + 'as'
+ env['RANLIB'] = mingw + 'ranlib'
+ env['LINK'] = mingw + 'gcc'
+ env['AS'] = mingw + 'as'
+ env['AR'] = mingw + 'ar'
+
env['WIN32DEFPREFIX'] = ''
env['WIN32DEFSUFFIX'] = '.def'
+ env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'
+ env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'
+
env['SHOBJSUFFIX'] = '.o'
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
- env['RC'] = mingw_prefix + 'windres'
+ env['RC'] = mingw + 'windres'
env['RCFLAGS'] = SCons.Util.CLVar('')
- env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET)} $)'
+ env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
env['RCINCPREFIX'] = '--include-dir '
env['RCINCSUFFIX'] = ''
- env['RCCOM'] = '$RC $RCINCFLAGS $RCINCPREFIX $SOURCE.dir $RCFLAGS -i $SOURCE -o $TARGET'
+ env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
env['BUILDERS']['RES'] = res_builder
# Some setting from the platform also have to be overridden:
@@ -187,3 +175,9 @@ def generate(env):
def exists(env):
return find(env)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: