~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to SConstruct

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
import os.path
47
47
import string
48
48
import shutil
49
 
import glob
50
49
import re
51
 
from tempfile import mkdtemp
52
50
 
53
51
# store path to tools
54
52
toolpath=os.path.join(".", "build_files", "scons", "tools")
58
56
 
59
57
import Blender
60
58
import btools
61
 
import bcolors
62
59
 
63
60
EnsureSConsVersion(1,0,0)
64
61
 
121
118
 
122
119
if bitness:
123
120
    B.bitness = bitness
124
 
else: 
 
121
else:
125
122
    B.bitness = tempbitness
126
123
 
127
124
 
140
137
    B.quickie=[]
141
138
 
142
139
toolset = B.arguments.get('BF_TOOLSET', None)
 
140
vcver = B.arguments.get('MSVS_VERSION', '9.0')
 
141
 
143
142
if toolset:
144
143
    print "Using " + toolset
145
144
    if toolset=='mstoolkit':
151
150
            btools.SetupSpawn(env)
152
151
else:
153
152
    if bitness==64 and platform=='win32':
154
 
        env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
 
153
        env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64', TARGET_ARCH='x86_64', MSVC_VERSION=vcver)
155
154
    else:
156
 
        env = BlenderEnvironment(ENV = os.environ)
 
155
        env = BlenderEnvironment(ENV = os.environ, TARGET_ARCH='x86', MSVC_VERSION=vcver)
157
156
 
158
157
if not env:
159
158
    print "Could not create a build environment"
172
171
    elif env['CC'] in ['gcc']:
173
172
        platform = 'win64-mingw' if bitness == 64 else 'win32-mingw'
174
173
 
 
174
if 'mingw' in platform:
 
175
    print "Setting custom spawn function"
 
176
    btools.SetupSpawn(env)
 
177
 
175
178
env.SConscriptChdir(0)
176
179
 
177
180
# Remove major kernel version from linux platform.
269
272
    target_env_defs['WITH_BF_PYTHON'] = False
270
273
    target_env_defs['WITH_BF_3DMOUSE'] = False
271
274
    target_env_defs['WITH_BF_LIBMV'] = False
 
275
    target_env_defs['WITH_BF_FREESTYLE'] = False
272
276
 
273
277
    # Merge blenderlite, let command line to override
274
278
    for k,v in target_env_defs.iteritems():
302
306
            env.Append(LINKFLAGS=['-F/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
303
307
            env['BF_3DMOUSE_INC'] = '/Library/Frameworks/3DconnexionClient.framework/Headers'
304
308
 
305
 
    # for now, Mac builders must download and install the JackOSX framework 
 
309
    # for now, Mac builders must download and install the JackOSX framework
306
310
    # necessary header file lives here when installed:
307
311
    # /Library/Frameworks/Jackmp.framework/Versions/A/Headers/jack.h
308
312
    if env['WITH_BF_JACK'] == 1:
312
316
        else:
313
317
            env.Append(LINKFLAGS=['-L/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','Jackmp'])
314
318
 
315
 
    if env['WITH_BF_CYCLES_OSL'] == 1:  
 
319
    if env['WITH_BF_CYCLES_OSL'] == 1:
316
320
        OSX_OSL_LIBPATH = Dir(env.subst(env['BF_OSL_LIBPATH'])).abspath
317
321
        # we need 2 variants of passing the oslexec with the force_load option, string and list type atm
318
322
        env.Append(LINKFLAGS=['-L'+OSX_OSL_LIBPATH,'-loslcomp','-force_load '+ OSX_OSL_LIBPATH +'/liboslexec.a','-loslquery'])
319
323
        env.Append(BF_PROGRAM_LINKFLAGS=['-Xlinker','-force_load','-Xlinker',OSX_OSL_LIBPATH +'/liboslexec.a'])
320
324
 
321
 
    # Trying to get rid of eventually clashes, we export some explicite as local symbols                
 
325
    # Trying to get rid of eventually clashes, we export some explicite as local symbols
322
326
    env.Append(LINKFLAGS=['-Xlinker','-unexported_symbols_list','-Xlinker','./source/creator/osx_locals.map'])
323
327
 
324
328
if env['WITH_BF_OPENMP'] == 1:
329
333
                env.Append(LINKFLAGS=['-openmp', '-static-intel'])
330
334
                env['CCFLAGS'].append('-openmp')
331
335
            else:
332
 
                env.Append(CCFLAGS=['-fopenmp']) 
 
336
                env.Append(CCFLAGS=['-fopenmp'])
333
337
 
334
338
if env['WITH_GHOST_COCOA'] == True:
335
 
    env.Append(CPPFLAGS=['-DGHOST_COCOA']) 
 
339
    env.Append(CPPFLAGS=['-DGHOST_COCOA'])
336
340
 
337
341
if env['USE_QTKIT'] == True:
338
342
    env.Append(CPPFLAGS=['-DUSE_QTKIT'])
369
373
 
370
374
# build with ocean sim?
371
375
if env['WITH_BF_OCEANSIM'] == 1:
372
 
    env['WITH_BF_FFTW3']  = 1  # ocean needs fftw3 so enable it 
 
376
    env['WITH_BF_FFTW3']  = 1  # ocean needs fftw3 so enable it
373
377
    env['CPPFLAGS'].append('-DWITH_MOD_OCEANSIM')
374
378
 
375
379
 
382
386
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
383
387
env['CPPFLAGS'].append('-DWITH_AVI')
384
388
env['CPPFLAGS'].append('-DWITH_BOOL_COMPAT')
 
389
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc') and env['MSVC_VERSION'] == '11.0':
 
390
    env['CPPFLAGS'].append('-D_ALLOW_KEYWORD_MACROS')
 
391
 
 
392
if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
 
393
    env['CPPFLAGS'].append('-DHAVE_STDBOOL_H')
385
394
 
386
395
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
387
396
B.root_build_dir = env['BF_BUILDDIR']
513
522
        filename_only = os.path.basename(FILE_FROM)
514
523
        FILE_TO = os.path.join(env['DATA_SOURCES'], filename_only + ".c")
515
524
        VAR_NAME = "datatoc_" + filename_only.replace(".", "_")
516
 
        
 
525
 
517
526
        data_to_c(FILE_FROM, FILE_TO, VAR_NAME)
518
 
        
 
527
 
519
528
 
520
529
if B.targets != ['cudakernels']:
521
530
    data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
527
536
    data_to_c_simple("release/datafiles/preview_cycles.blend")
528
537
 
529
538
    # --- glsl ---
530
 
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
531
 
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
 
539
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_frag.glsl")
 
540
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_vert.glsl")
 
541
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
 
542
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
532
543
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
533
544
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
534
 
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
 
545
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
535
546
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
536
547
    data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
537
548
 
710
721
                if VERSION_RELEASE_CYCLE == "release" and "addons_contrib" in dn:
711
722
                    dn.remove('addons_contrib')
712
723
 
 
724
                # do not install freestyle if disabled
 
725
                if not env['WITH_BF_FREESTYLE'] and "freestyle" in dn:
 
726
                    dn.remove("freestyle")
 
727
 
713
728
                dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
714
729
                dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
715
730
 
900
915
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
901
916
    dllsources = []
902
917
 
903
 
    dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
904
918
    # Used when linking to libtiff was dynamic
905
919
    # keep it here until compilation on all platform would be ok
906
920
    # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
930
944
 
931
945
    if env['WITH_BF_OPENAL']:
932
946
        dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
933
 
        dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
 
947
        if env['OURPLATFORM'] in ('win32-vc', 'win64-vc') and env['MSVC_VERSION'] == '11.0':
 
948
            pass
 
949
        else:
 
950
            dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
934
951
 
935
952
    if env['WITH_BF_SNDFILE']:
936
953
        dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
951
968
 
952
969
        else:
953
970
            dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
954
 
                        
 
971
 
955
972
    dllsources.append('#source/icons/blender.exe.manifest')
956
973
 
957
974
    windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
981
998
 
982
999
    if(env['WITH_BF_OPENMP']):
983
1000
        dllsources.append('${LCGDIR}/binaries/libgomp-1.dll')
984
 
                
 
1001
 
985
1002
    if env['WITH_BF_OCIO']:
986
1003
        dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
987
1004