fix for bug of long group long name, bug found and fixed for bmx007
[blender-staging.git] / SConstruct
index d6d1678c2946d9909cacc19e62eda2cc9daf4667..695fd29795b403230783a55289ef97a2ba8e653f 100644 (file)
@@ -11,6 +11,7 @@ bs_globals.targets = COMMAND_LINE_TARGETS
 
 print 'targets = ',bs_globals.targets
 print 'arguments = ', bs_globals.arguments
+print os.getcwd()
 
 appname = ''
 playername = ''
@@ -25,7 +26,10 @@ if sys.platform != 'win32':
        config_guess = os.popen("SRCHOME=source/ source/tools/guess/guessconfig").read()[:-1]
 else:
        config_guess = "windows"
-       
+
+#the above check is not enough for darwin. we way want to build for darwin/X11
+#more, now even for Os X, we need to check and take in account arch 
+#(PPC, x86, universal binaries)        
 if sys.platform == 'darwin':
        appname = 'blender'
        playername = 'blenderplayer'
@@ -42,12 +46,16 @@ bs_config.parseOpts()
 # don't want to put scons-generated .sconsign files in the source tree, but in
 # the root_build_dir, we have to create that dir ourselves before SCons tries
 # to access/create the file containing .sconsign data.
+# we need to create the top level hierarchy too (at least on Os X) 
 if os.path.isdir (bs_globals.root_build_dir) == 0:
        os.makedirs (bs_globals.root_build_dir)
+       os.makedirs (bs_globals.root_build_dir+os.sep+'extern')
+       os.makedirs (bs_globals.root_build_dir+os.sep+'intern')
+       os.makedirs (bs_globals.root_build_dir+os.sep+'source')
 
 # Blender version.
-version='2.37a'
-shortversion = '237a' # for wininst target -> nsis installer creation
+version='2.40-alpha1'
+shortversion = '240alpha1' # for wininst target -> nsis installer creation
 
 sdl_env = Environment (ENV = os.environ)
 freetype_env = Environment (ENV = os.environ)
@@ -59,13 +67,15 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'true'
        use_sumo = 'true'
        use_ode = 'false'
-       use_bullet = 'false'
+       use_bullet = 'true'
        use_buildinfo = 'true'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
-       build_blender_player = 'true'
+       build_blender_player = 'false'
        build_blender_plugin = 'false'
        release_flags = ['-O2']
        debug_flags = ['-O2', '-g']
@@ -86,10 +96,20 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
        png_lib = ['png']
        png_libpath = ['/usr/lib']
        png_include = ['/usr/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['/usr/lib']
        jpeg_include = ['/usr/include']
+       #tiff library information
+       tiff_lib = ['tiff']
+       tiff_libpath = ['/usr/lib']
+       tiff_include = ['/usr/include']
        # OpenGL library information
        opengl_lib = ['GL', 'GLU']
        opengl_static = ['/usr/lib/libGL.a', '/usr/lib/libGLU.a']
@@ -142,13 +162,15 @@ elif sys.platform == 'darwin':
        use_gameengine = 'true'
        use_openal = 'true'
        use_fmod = 'false'
-       use_openal = 'false'
+       use_openal = 'true'
        use_quicktime = 'true'
+       use_openexr = 'true'
        use_precomp = 'true'
        use_sumo = 'true'
        use_ode = 'false'
-       use_bullet = 'false'
+       use_bullet = 'true'
        use_buildinfo = 'true'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'true'
@@ -184,10 +206,20 @@ elif sys.platform == 'darwin':
        png_lib = ['libpng']
        png_libpath = [darwin_precomp + 'png/lib']
        png_include = [darwin_precomp + 'png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/local/lib']
+       openexr_include = ['/usr/local/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['libjpeg']
        jpeg_libpath = [darwin_precomp + 'jpeg/lib']
        jpeg_include = [darwin_precomp + 'jpeg/include']
+       # TIFF library information
+       tiff_lib = ['libtiff']
+       tiff_libpath = [darwin_precomp + 'tiff/lib']
+       tiff_include = [darwin_precomp + 'tiff/include']
        # OpenGL library information
        opengl_lib = ['GL', 'GLU']
        opengl_static = []
@@ -241,8 +273,8 @@ elif sys.platform == 'darwin':
                                                '-framework', 'IOKit' , 
                                                '-framework', 'AppKit']
        # International stuff
-       ftgl_lib = []
-       ftgl_libpath = []
+       ftgl_lib = ['libftgl']
+       ftgl_libpath = [darwin_precomp + 'ftgl/lib']
        ftgl_include = ['#extern/bFTGL/include']
        freetype_lib = ['libfreetype']
        freetype_libpath = [darwin_precomp + 'freetype/lib']
@@ -261,10 +293,12 @@ elif sys.platform == 'cygwin':
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'true'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
        use_buildinfo = 'false'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'false'
@@ -290,10 +324,20 @@ elif sys.platform == 'cygwin':
        png_lib = ['png']
        png_libpath = ['#../lib/windows/png/lib']
        png_include = ['#../lib/windows/png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['#../lib/windows/jpeg/lib']
        jpeg_include = ['#../lib/windows/jpeg/include']
+       # Tiff Library information
+       tiff_lib = ['libtiff']
+       tiff_libpath = ['#../lib/windows/tiff/lib']
+       tiff_include = ['#../lib/windows/tiff/include']
        # OpenGL library information
        opengl_lib = ['opengl32', 'glu32']
        opengl_static = []
@@ -346,10 +390,12 @@ elif sys.platform == 'win32':
        use_openal = 'true'
        use_fmod = 'false'
        use_quicktime = 'true'
+       use_openexr = 'true'
+       use_bullet = 'true'
        use_sumo = 'true'
        use_ode = 'false'
-       use_bullet = 'false'
        use_buildinfo = 'true'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'true'
@@ -359,15 +405,16 @@ elif sys.platform == 'win32':
        extra_flags = ['/EHsc', '/J', '/W3', '/Gd', '/MT']
        cxxflags = []
        defines = ['WIN32', '_CONSOLE']
-       defines += ['WITH_QUICKTIME']
+       if use_quicktime == 'true':
+               defines += ['WITH_QUICKTIME']
        defines += ['_LIB', 'USE_OPENAL']
        defines += ['FTGL_LIBRARY_STATIC']
        warn_flags = []
        platform_libs = [ 'qtmlClient', 'soundsystem',
                                         'ws2_32', 'dxguid', 'vfw32', 'winmm',
                                         'iconv', 'kernel32', 'user32', 'gdi32',
-                                        'winspool', 'comdlg32', 'advapi32', 'shell32',
-                                        'ole32', 'oleaut32', 'uuid', 'odbc32', 'odbccp32',
+                                        'comdlg32', 'advapi32', 'shell32',
+                                        'ole32', 'oleaut32', 'uuid', 
                                         'libcmt', 'libc']
        platform_libpath = ['#../lib/windows/iconv/lib',
                                                '#../lib/windows/QTDevWin/Libraries']
@@ -396,10 +443,20 @@ elif sys.platform == 'win32':
        png_lib = ['libpng_st']
        png_libpath = ['#../lib/windows/png/lib']
        png_include = ['#../lib/windows/png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['libjpeg']
        jpeg_libpath = ['#../lib/windows/jpeg/lib']
        jpeg_include = ['#../lib/windows/jpeg/include']
+       # Tiff Library information
+       tiff_lib = ['libtiff']
+       tiff_libpath = ['#../lib/windows/tiff/lib']
+       tiff_include = ['#../lib/windows/tiff/include']
        # OpenGL library information
        opengl_lib = ['opengl32', 'glu32']
        opengl_static = []
@@ -427,9 +484,9 @@ elif sys.platform == 'win32':
        ode_libpath = ['#../lib/windows/ode/lib']
        ode_include = ['#../lib/windows/ode/include']
        # Python lib name
-       python_include = ['#../lib/windows/python/include/python2.3']
+       python_include = ['#../lib/windows/python/include/python2.4']
        python_libpath = ['#../lib/windows/python/lib']
-       python_lib = ['python23']
+       python_lib = ['python24']
        python_linkflags = []
        # International stuff
        ftgl_lib = []
@@ -452,10 +509,12 @@ elif string.find (sys.platform, 'sunos') != -1:
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
        use_buildinfo = 'false'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'false'
@@ -479,6 +538,12 @@ elif string.find (sys.platform, 'sunos') != -1:
        png_lib = ['png']
        png_libpath = []
        png_include = []
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = []
@@ -535,10 +600,12 @@ elif string.find (sys.platform, 'irix') != -1:
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
        use_buildinfo = 'false'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'false'
@@ -570,6 +637,12 @@ elif string.find (sys.platform, 'irix') != -1:
        png_lib = ['png']
        png_libpath = [irix_precomp + '/png/lib']
        png_include = [irix_precomp + '/png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = [irix_precomp + '/jpeg/lib']
@@ -630,10 +703,12 @@ elif sys.platform=='openbsd3':
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
        use_buildinfo = 'true'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'false'
@@ -656,6 +731,12 @@ elif sys.platform=='openbsd3':
        png_lib = ['png']
        png_libpath = ['/usr/local/lib']
        png_include = ['/usr/local/include/libpng']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['/usr/local/lib']
@@ -714,10 +795,12 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
        use_buildinfo = 'true'
+       use_fluidsim = 'true'
        build_blender_dynamic = 'true'
        build_blender_static = 'false'
        build_blender_player = 'false'
@@ -740,6 +823,12 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
        png_lib = ['png']
        png_libpath = ['/usr/local/lib']
        png_include = ['/usr/local/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['/usr/local/lib']
@@ -834,13 +923,15 @@ else:
        config.write ("BUILD_GAMEENGINE = %r\n"%(use_gameengine))
        if use_ode == 'true':
                config.write ("USE_PHYSICS = 'ode'\n")
-       elif use_bullet == 'true':
+       elif (use_bullet == 'true') and (use_sumo == 'false'):
                config.write("USE_PHYSICS = 'bullet'\n")
        else:
                config.write ("USE_PHYSICS = 'solid'\n")
        config.write ("USE_OPENAL = %r\n"%(use_openal))
        config.write ("USE_FMOD = %r\n"%(use_fmod))
        config.write ("USE_QUICKTIME = %r\n"%(use_quicktime))
+       config.write ("USE_OPENEXR = %r\n"%(use_openexr))
+       config.write ("USE_FLUIDSIM = %r\n"%(use_fluidsim))
        config.write ("\n# Compiler information.\n")
        config.write ("HOST_CC = %r\n"%(env_dict['CC']))
        config.write ("HOST_CXX = %r\n"%(env_dict['CXX']))
@@ -866,9 +957,15 @@ else:
        config.write ("PNG_INCLUDE = %r\n"%(png_include))
        config.write ("PNG_LIBPATH = %r\n"%(png_libpath))
        config.write ("PNG_LIBRARY = %r\n"%(png_lib))
+        config.write ("OPENEXR_INCLUDE = %r\n"%(openexr_include))
+        config.write ("OPENEXR_LIBPATH = %r\n"%(openexr_libpath))
+        config.write ("OPENEXR_LIBRARY = %r\n"%(openexr_lib))
        config.write ("JPEG_INCLUDE = %r\n"%(jpeg_include))
        config.write ("JPEG_LIBPATH = %r\n"%(jpeg_libpath))
        config.write ("JPEG_LIBRARY = %r\n"%(jpeg_lib))
+       config.write ("TIFF_INCLUDE = %r\n"%(tiff_include))
+       config.write ("TIFF_LIBPATH = %r\n"%(tiff_libpath))
+       config.write ("TIFF_LIBRARY = %r\n"%(tiff_lib))
        config.write ("OPENGL_INCLUDE = %r\n"%(opengl_include))
        config.write ("OPENGL_LIBPATH = %r\n"%(opengl_libpath))
        config.write ("OPENGL_LIBRARY = %r\n"%(opengl_lib))
@@ -949,6 +1046,12 @@ user_options.AddOptions (
                (BoolOption ('USE_QUICKTIME',
                                        'Set to 1 to add support for QuickTime.',
                                        'false')),
+               (BoolOption ('USE_OPENEXR',
+                                        'Set to 1 to add support for OpenEXR.',
+                                        'false')),
+               (BoolOption ('USE_FLUIDSIM', # NT test new
+                                       'Set to 0 to disable compilation of fluid simulation library El\'Beem.',
+                                       'true')),
                ('HOST_CC', 'C compiler for the host platfor. This is the same as target platform when not cross compiling.'),
                ('HOST_CXX', 'C++ compiler for the host platform. This is the same as target platform when not cross compiling.'),
                ('TARGET_CC', 'C compiler for the target platform.'),
@@ -972,9 +1075,15 @@ user_options.AddOptions (
                ('PNG_INCLUDE', 'Include directory for png header files.'),
                ('PNG_LIBPATH', 'Library path where the png library is located.'),
                ('PNG_LIBRARY', 'png library name.'),
+                ('OPENEXR_INCLUDE', 'Include directory for OpenEXR header files.'),
+                ('OPENEXR_LIBPATH', 'Library path where the OpenEXR libraries are located.'),
+                ('OPENEXR_LIBRARY', 'OpenEXR library names.'),
                ('JPEG_INCLUDE', 'Include directory for jpeg header files.'),
                ('JPEG_LIBPATH', 'Library path where the jpeg library is located.'),
                ('JPEG_LIBRARY', 'jpeg library name.'),
+               ('TIFF_INCLUDE', 'Include directory for TIFF header files.'),
+               ('TIFF_LIBPATH', 'Library path where the TIFF library is located.'),
+               ('TIFF_LIBRARY', 'TIFF library name.'),
                ('OPENGL_INCLUDE', 'Include directory for OpenGL header files.'),
                ('OPENGL_LIBPATH', 'Library path where the OpenGL libraries are located.'),
                ('OPENGL_LIBRARY', 'OpenGL library names.'),
@@ -1026,10 +1135,9 @@ bs_globals.config_guess = config_guess
 
 if user_options_dict['BUILD_GAMEENGINE'] == 1:
        defines += ['GAMEBLENDER=1']
+       defines += ['USE_BULLET']
        if user_options_dict['USE_PHYSICS'] == 'ode':
                defines += ['USE_ODE']
-       elif user_options_dict['USE_PHYSICS'] == 'bullet':
-               defines += ['USE_BULLET']
        else:
                defines += ['USE_SUMO_SOLID']
 else:
@@ -1050,6 +1158,9 @@ platform_linkflags += user_options_dict['LDFLAGS']
 
 user_options_dict['PLATFORM_LINKFLAGS'] = platform_linkflags
 
+if user_options_dict['USE_FLUIDSIM'] == 0: # NT test new
+       use_fluidsim='false';
+
 #-----------------------------------------------------------------------------
 # Generic library generation environment. This one is the basis for each
 # library.
@@ -1076,6 +1187,7 @@ if bs_globals.enable_clean==0: # only read SConscripts when not cleaning, this t
        Export ('user_options_dict')
        Export ('library_env')
        Export ('sdl_env')
+       Export ('use_fluidsim') # NT test
        
        BuildDir (bs_globals.root_build_dir+'/extern', 'extern', duplicate=0)
        SConscript (bs_globals.root_build_dir+'extern/SConscript')