diff options
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 70 |
1 files changed, 58 insertions, 12 deletions
diff --git a/SConstruct b/SConstruct index e928970f6b8..2531872af6c 100644 --- a/SConstruct +++ b/SConstruct @@ -111,6 +111,11 @@ btools.print_targets(B.targets, B.bc) # handling cmd line arguments & config file +# bitness stuff +tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness found as per starting python +if tempbitness in (32, 64): # only set if 32 or 64 has been given + bitness = int(tempbitness) + # first check cmdline for toolset and we create env to work on quickie = B.arguments.get('BF_QUICK', None) quickdebug = B.arguments.get('BF_QUICKDEBUG', None) @@ -161,6 +166,13 @@ if sys.platform=='win32': env.SConscriptChdir(0) +# Remove major kernel version from linux platform. +# After Linus switched kernel to new version model this major version +# shouldn't take much sense for building rules. + +if re.match('linux[0-9]+', platform): + platform = 'linux' + crossbuild = B.arguments.get('BF_CROSS', None) if crossbuild and platform not in ('win32-vc', 'win64-vc'): platform = 'linuxcross' @@ -241,12 +253,31 @@ if 'blenderlite' in B.targets: target_env_defs['BF_BUILDINFO'] = False target_env_defs['BF_NO_ELBEEM'] = True target_env_defs['WITH_BF_PYTHON'] = False + target_env_defs['WITH_BF_3DMOUSE'] = False # Merge blenderlite, let command line to override for k,v in target_env_defs.iteritems(): if k not in B.arguments: env[k] = v +# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX +if env['OURPLATFORM']=='darwin': + print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --" + print "Available " + env['MACOSX_SDK_CHECK'] + if not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']: + print B.bc.OKGREEN + "MacOSX10.5.sdk not available:" + B.bc.ENDC + " using MacOSX10.6.sdk" + else: + print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk" + + # for now, Mac builders must download and install the 3DxWare 10 Beta 4 driver framework from 3Dconnexion + # necessary header file lives here when installed: + # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h + if env['WITH_BF_3DMOUSE'] == 1: + if not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'): + print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors ! + env['WITH_BF_3DMOUSE'] = 0 + else: + env.Append(LINKFLAGS=['-weak_framework','3DconnexionClient']) if env['WITH_BF_OPENMP'] == 1: if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): @@ -306,9 +337,10 @@ if env['BF_NO_ELBEEM'] == 1: env['CXXFLAGS'].append('-DDISABLE_ELBEEM') env['CCFLAGS'].append('-DDISABLE_ELBEEM') -if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'): - env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup') - env['PLATFORM_LINKFLAGS'].append('/ENTRY:main') +# TODO, make optional +env['CPPFLAGS'].append('-DWITH_AUDASPACE') +env['CXXFLAGS'].append('-DWITH_AUDASPACE') +env['CCFLAGS'].append('-DWITH_AUDASPACE') # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir B.root_build_dir = env['BF_BUILDDIR'] @@ -360,6 +392,23 @@ if not quickie and do_clean: print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC Exit() + +# ensure python header is found since detection can fail, this could happen +# with _any_ library but since we used a fixed python version this tends to +# be most problematic. +if env['WITH_BF_PYTHON']: + py_h = os.path.join(Dir(env.subst('${BF_PYTHON_INC}')).abspath, "Python.h") + + if not os.path.exists(py_h): + print("\nMissing: \"" + env.subst('${BF_PYTHON_INC}') + os.sep + "Python.h\",\n" + " Set 'BF_PYTHON_INC' to point " + "to a valid python include path.\n Containing " + "Python.h for python version \"" + env.subst('${BF_PYTHON_VERSION}') + "\"") + + Exit() + del py_h + + if not os.path.isdir ( B.root_build_dir): os.makedirs ( B.root_build_dir ) os.makedirs ( B.root_build_dir + 'source' ) @@ -409,17 +458,18 @@ if B.arguments.get('BF_PRIORITYLIST', '0')=='1': B.propose_priorities() dobj = B.buildinfo(env, "dynamic") + B.resources +creob = B.creator(env) thestatlibs, thelibincs = B.setup_staticlibs(env) thesyslibs = B.setup_syslibs(env) if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: - env.BlenderProg(B.root_build_dir, "blender", mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') + env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') playerlist += B.create_blender_liblist(env, 'player2') playerlist += B.create_blender_liblist(env, 'intern') playerlist += B.create_blender_liblist(env, 'extern') - env.BlenderProg(B.root_build_dir, "blenderplayer", playerlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') + env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets @@ -508,7 +558,7 @@ if env['OURPLATFORM']!='darwin': scriptinstall.append(env.Install(dir=dir,source=source)) #-- icons -if env['OURPLATFORM']=='linux2': +if env['OURPLATFORM']=='linux': iconlist = [] icontargetlist = [] @@ -587,7 +637,7 @@ textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist) if env['OURPLATFORM']=='darwin': allinstall = [blenderinstall, plugininstall, textinstall] -elif env['OURPLATFORM']=='linux2': +elif env['OURPLATFORM']=='linux': allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall] else: allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall] @@ -639,11 +689,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'): dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll') if env['WITH_BF_FFMPEG']: - dllsources += ['${BF_FFMPEG_LIBPATH}/avcodec-52.dll', - '${BF_FFMPEG_LIBPATH}/avformat-52.dll', - '${BF_FFMPEG_LIBPATH}/avdevice-52.dll', - '${BF_FFMPEG_LIBPATH}/avutil-50.dll', - '${BF_FFMPEG_LIBPATH}/swscale-0.dll'] + dllsources += env['BF_FFMPEG_DLL'].split() # Since the thumb handler is loaded by Explorer, architecture is # strict: the x86 build fails on x64 Windows. We need to ship |