Dean Giberson avatar Dean Giberson committed 1e090b1 Merge

Merge remote-tracking branch 'upstream/master'

Comments (0)

Files changed (577)

blender/CMakeLists.txt

 option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
 option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default (recommend to leave off)" OFF)
 mark_as_advanced(WITH_PYTHON)  # dont want people disabling this unless they really know what they are doing.
-mark_as_advanced(WITH_PYTHON_SECURITY)  # some distrobutions see this as a security issue, rather than have them patch it, make a build option.
+mark_as_advanced(WITH_PYTHON_SECURITY)  # some distributions see this as a security issue, rather than have them patch it, make a build option.
 
 option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
 option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
 option(WITH_IMAGE_FRAMESERVER   "Enable image FrameServer Support for rendering" ON)
 
 # Audio/Video format support
+option(WITH_CODEC_AVI           "Enable Blenders own AVI file support (raw/jpeg)" ON)
 option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
 
 option(WITH_CODEC_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
 mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
 unset(PLATFORM_DEFAULT)
 
+# LLVM
+option(WITH_LLVM					"Use LLVM" OFF)
+
 # disable for now, but plan to support on all platforms eventually
 option(WITH_MEM_JEMALLOC   "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
 mark_as_advanced(WITH_MEM_JEMALLOC)
 	option(WITH_COCOA	  "Use Cocoa framework instead of deprecated Carbon" ON)
 	option(USE_QTKIT	  "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
 	option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
+	if(CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
+		set(USE_QTKIT ON CACHE BOOL "ON" FORCE) # no Quicktime in 64bit
+	endif()
 endif()
 
 
 	set(WITH_BOOST ON)
 endif()
 
-# don't store paths to libs for portable distrobution
+# auto enable llvm for cycles_osl
+if(WITH_CYCLES_OSL)
+	set(WITH_LLVM ON CACHE BOOL "ON" FORCE)
+endif()
+
+# don't store paths to libs for portable distribution
 if(WITH_INSTALL_PORTABLE)
 	set(CMAKE_SKIP_BUILD_RPATH TRUE)
 endif()
 
 		mark_as_advanced(FFMPEG)
 
-		# lame, but until we have propper find module for ffmpeg
+		# lame, but until we have proper find module for ffmpeg
 		set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
 		if(EXISTS "${FFMPEG}/include/ffmpeg/")
-			set(FFMPEG_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS} ${FFMPEG}/include/ffmpeg")
+			list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
 		endif()
 		# end lameness
 
 			else()
 				set(Boost_USE_MULTITHREADED ON)
 			endif()
-			find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
+			if(WITH_CYCLES_OSL)
+				find_package(Boost 1.34 COMPONENTS filesystem python3 regex system thread) # osl_nodes uses boost_python
+			else()
+				find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
+			endif()
 			mark_as_advanced(Boost_DIR)  # why doesnt boost do this?
 		endif()
 
 		endif()
 	endif()
 
+	if(WITH_LLVM)
+		set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH	"Path to the LLVM installation")
+		set(LLVM_VERSION "3.0" CACHE STRING	"Version of LLVM to use" "")
+		set(LLVM_STATIC YES)
+		if(LLVM_DIRECTORY)
+			set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
+		else()
+			set(LLVM_CONFIG llvm-config)
+		endif()
+		execute_process(COMMAND ${LLVM_CONFIG} --version
+		                OUTPUT_VARIABLE LLVM_VERSION
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		execute_process(COMMAND ${LLVM_CONFIG} --prefix
+		                OUTPUT_VARIABLE LLVM_DIRECTORY
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		execute_process(COMMAND ${LLVM_CONFIG} --libdir
+		                OUTPUT_VARIABLE LLVM_LIB_DIR
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		execute_process(COMMAND ${LLVM_CONFIG} --includedir
+		                OUTPUT_VARIABLE LLVM_INCLUDES
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		find_library(LLVM_LIBRARY
+		             NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
+		             PATHS ${LLVM_LIB_DIR})
+		message(STATUS "LLVM version  = ${LLVM_VERSION}")
+		message(STATUS "LLVM dir      = ${LLVM_DIRECTORY}")
+		message(STATUS "LLVM includes = ${LLVM_INCLUDES}")
+		message(STATUS "LLVM lib dir  = ${LLVM_LIB_DIR}")
+
+		if(LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
+			# ensure include directory is added (in case of non-standard locations
+			include_directories(BEFORE "${LLVM_INCLUDES}")
+			string(REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
+			message(STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
+			add_definitions("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
+			if(LLVM_STATIC)
+				# if static LLVM libraries were requested, use llvm-config to generate
+				# the list of what libraries we need, and substitute that in the right
+				# way for LLVM_LIBRARY.
+				execute_process(COMMAND ${LLVM_CONFIG} --libfiles
+				                OUTPUT_VARIABLE LLVM_LIBRARY
+				                OUTPUT_STRIP_TRAILING_WHITESPACE)
+				string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
+			endif()
+			message(STATUS "LLVM library  = ${LLVM_LIBRARY}")
+		else()
+			message(FATAL_ERROR "LLVM not found.")
+		endif()
+	endif()
+
 	if(WITH_CYCLES_OSL)
 		set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
 	
 		find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
 		find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
 		find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
-		# WARNING! depends on correct order of OSL libs linking
-		list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
+		# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
+		# otherwise LLVM is missing the osl_allocate_closure_component function
+		list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -Wl,--whole-archive ${OSL_LIB_EXEC} -Wl,--no-whole-archive ${OSL_LIB_QUERY})
 		find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
 		find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
 	
 			endif()
 			set(BOOST_LIBRARIES
 				optimized libboost_date_time-${BOOST_POSTFIX} optimized libboost_filesystem-${BOOST_POSTFIX}
-				optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
+				optimized libboost_regex-${BOOST_POSTFIX}
+				optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
 				debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
-				debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
+				debug libboost_regex-${BOOST_DEBUG_POSTFIX}
+				debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
+				if(WITH_CYCLES_OSL)
+					set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+						optimized libboost_python3-${BOOST_POSTFIX}
+						debug libboost_python3-${BOOST_DEBUG_POSTFIX})
+				endif(WITH_CYCLES_OSL)
+				
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
 		endif()
 			
 			set(OPENCOLORIO ${LIBDIR}/opencolorio)
 			set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
 			set(OPENCOLORIO_LIBRARIES OpenColorIO)
-			set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib")
+			set(OPENCOLORIO_LIBPATH ${LIBDIR}/opencolorio/lib)
 			set(OPENCOLORIO_DEFINITIONS)
 		endif()
 
 			endif()		
 			set(BOOST_LIBRARIES
 				optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
-				boost_regex-${BOOST_POSTFIX} boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
+				boost_regex-${BOOST_POSTFIX}
+				boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
 				debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX}
-				boost_regex-${BOOST_DEBUG_POSTFIX} boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
+				boost_regex-${BOOST_DEBUG_POSTFIX}
+				boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
+				if(WITH_CYCLES_OSL)
+					set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+						optimized libboost_python3-${BOOST_POSTFIX}
+						debug libboost_python3-${BOOST_DEBUG_POSTFIX}) 
+				endif(WITH_CYCLES_OSL)
+					
 			set(BOOST_LIBPATH ${BOOST}/lib)
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
 		endif()
 		set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
 
 		## DISABLE - causes linking errors 
-		## for re-distrobution, so users dont need mingw installed
+		## for re-distribution, so users dont need mingw installed
 		# set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++")
 
 	endif()
 
 	if(WITH_IMAGE_OPENEXR)
 		set(OPENEXR ${LIBDIR}/openexr)
+		set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
 		set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
 		set(OPENEXR_LIBRARIES Iex Half IlmImf Imath IlmThread)
 		set(OPENEXR_LIBPATH ${OPENEXR}/lib)
 	if(WITH_BOOST)
 		set(BOOST ${LIBDIR}/boost)
 		set(BOOST_INCLUDE_DIR ${BOOST}/include)
-		set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
+		if(WITH_CYCLES_OSL)
+			set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_python3-mt boost_regex-mt boost_system-mt boost_thread-mt)
+		else(WITH_CYCLES_OSL)
+			set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
+		endif(WITH_CYCLES_OSL)
 		set(BOOST_LIBPATH ${BOOST}/lib)
 		set(BOOST_DEFINITIONS)
 	endif()
 	if(WITH_OPENIMAGEIO)
 		set(OPENIMAGEIO ${LIBDIR}/openimageio)
 		set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
-		set(OPENIMAGEIO_LIBRARIES OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
+		set(OPENIMAGEIO_LIBRARIES -force_load ${OPENIMAGEIO}/lib/libOpenImageIO.a ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
 		set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
 		set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
 	endif()
 		set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
 	endif()
 
+	if(WITH_LLVM)
+		set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH	"Path to the LLVM installation")
+		set(LLVM_VERSION "3.1" CACHE STRING	"Version of LLVM to use" "")
+		set(LLVM_STATIC YES)
+		if(LLVM_DIRECTORY)
+			set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
+		else()
+			set(LLVM_CONFIG llvm-config)
+		endif()
+		execute_process(COMMAND ${LLVM_CONFIG} --version
+		                OUTPUT_VARIABLE LLVM_VERSION
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		execute_process(COMMAND ${LLVM_CONFIG} --prefix
+		                OUTPUT_VARIABLE LLVM_DIRECTORY
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		execute_process(COMMAND ${LLVM_CONFIG} --libdir
+		                OUTPUT_VARIABLE LLVM_LIB_DIR
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		execute_process(COMMAND ${LLVM_CONFIG} --includedir
+		                OUTPUT_VARIABLE LLVM_INCLUDES
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		find_library(LLVM_LIBRARY
+		             NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
+		             PATHS ${LLVM_LIB_DIR})
+		message(STATUS "LLVM version  = ${LLVM_VERSION}")
+		message(STATUS "LLVM dir      = ${LLVM_DIRECTORY}")
+		message(STATUS "LLVM includes = ${LLVM_INCLUDES}")
+		message(STATUS "LLVM lib dir  = ${LLVM_LIB_DIR}")
+
+		if(LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
+			# ensure include directory is added (in case of non-standard locations
+			include_directories(BEFORE "${LLVM_INCLUDES}")
+			string(REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
+			message(STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
+			add_definitions("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
+			if(LLVM_STATIC)
+				# if static LLVM libraries were requested, use llvm-config to generate
+				# the list of what libraries we need, and substitute that in the right
+				# way for LLVM_LIBRARY.
+				execute_process(COMMAND ${LLVM_CONFIG} --libfiles
+				                OUTPUT_VARIABLE LLVM_LIBRARY
+				                OUTPUT_STRIP_TRAILING_WHITESPACE)
+				string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
+			endif()
+			message(STATUS "LLVM library  = ${LLVM_LIBRARY}")
+		else()
+			message(FATAL_ERROR "LLVM not found.")
+		endif()
+	endif()
+
 	if(WITH_CYCLES_OSL)
 		set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
 	
 		find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
 		find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
 		# WARNING! depends on correct order of OSL libs linking
-		list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
+		list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
 		find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
 		find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
 	
 
 	set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
 	set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
-	if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
-		set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
-		set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
-	elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
-		set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
-		set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+	if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386")
+		set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
+		set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic  -msse -msse2 -msse3 -mssse3")
+		if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+			set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize  -fvariable-expansion-in-unroller")
+			set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize  -fvariable-expansion-in-unroller")
+		endif()
 	else()
 		set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
 		set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
 	if(NOT WITH_BOOST)
 		message(FATAL_ERROR "Cycles reqires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_CYCLES")
 	endif()
+
+	if(WITH_CYCLES_OSL)
+		if(NOT WITH_LLVM)
+			message(FATAL_ERROR "Cycles OSL reqires WITH_LLVM, the library may not have been found. Configure LLVM or disable WITH_CYCLES_OSL")
+		endif()
+	endif()
 endif()
 
 
 	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
 	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
 
-	# # this causes too many warnings, disable
-	# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
-
 	# disable because it gives warnings for printf() & friends.
 	# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
 
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
-	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_LOGICAL_OP -Wlogical-op)
-	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self)  # needs -Wuninitialized
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
-	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
+
+	# causes too many warnings
+	if(NOT APPLE)
+		ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
+		ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
+	endif()
 
 	# flags to undo strict flags
 	ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
 	info_cfg_option(WITH_OPENAL)
 	info_cfg_option(WITH_SDL)
 	info_cfg_option(WITH_JACK)
+	info_cfg_option(WITH_CODEC_AVI)
 	info_cfg_option(WITH_CODEC_FFMPEG)
 	info_cfg_option(WITH_CODEC_SNDFILE)
 

blender/GNUmakefile

 	@echo ""
 	@echo "Static Source Code Checking (not associated with building blender)"
 	@echo "  * check_cppcheck    - run blender source through cppcheck (C & C++)"
+	@echo "  * check_clang_array - run blender source through clang array checking script (C & C++)"
 	@echo "  * check_splint      - run blenders source through splint (C only)"
 	@echo "  * check_sparse      - run blenders source through sparse (C only)"
 	@echo "  * check_smatch      - run blenders source through smatch (C only)"
 	$(CMAKE_CONFIG)
 	cd $(BUILD_DIR) ; python3.2 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
 
+check_clang_array:
+	$(CMAKE_CONFIG)
+	cd $(BUILD_DIR) ; python3.2 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
+
 check_splint:
 	$(CMAKE_CONFIG)
 	cd $(BUILD_DIR) ; python3.2 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py

blender/SConstruct

 
 # TODO, make optional
 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
+env['CPPFLAGS'].append('-DWITH_AVI')
 
 # 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']

blender/build_files/buildbot/master.cfg

 from buildbot.changes.svnpoller import SVNPoller
 
 c['change_source'] = SVNPoller(
-       'https://svn.blender.org/svnroot/bf-blender/trunk/',
-       pollinterval=1200)
+    'https://svn.blender.org/svnroot/bf-blender/trunk/',
+    pollinterval=1200)
 
 # BUILDERS
 #
 #                        builderNames=buildernames,
 #                        periodicBuildTimer=24*60*60))
 
-c['schedulers'].append(timed.Nightly(name='nightly',
+c['schedulers'].append(timed.Nightly(
+    name='nightly',
     builderNames=buildernames,
     hour=3,
     minute=0))

blender/build_files/buildbot/master_unpack.py

 
 if platform == '':
     sys.stderr.write('Failed to detect platform ' +
-        'from package: %r\n' % packagename)
+                     'from package: %r\n' % packagename)
     sys.exit(1)
 
 # extract

blender/build_files/buildbot/slave_pack.py

         install_dir = os.path.join('..', 'install', builder)
 
         scons_options += ['WITH_BF_NOBLENDER=True', 'WITH_BF_PLAYER=False',
-            'BF_BUILDDIR=' + build_dir,
-            'BF_INSTALLDIR=' + install_dir,
-            'WITHOUT_BF_INSTALL=True']
+                          'BF_BUILDDIR=' + build_dir,
+                          'BF_INSTALLDIR=' + install_dir,
+                          'WITHOUT_BF_INSTALL=True']
 
         config = None
         bits = None

blender/build_files/cmake/clang_array_check.py

+# ---
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# ---
+# by Campbell Barton
+
+"""
+Invocation:
+
+   export CLANG_BIND_DIR="/dsk/src/llvm/tools/clang/bindings/python"
+   export CLANG_LIB_DIR="/opt/llvm/lib"
+
+   python2 clang_array_check.py somefile.c -DSOME_DEFINE -I/some/include
+
+... defines and includes are optional
+
+"""
+
+# delay parsing functions until we need them
+USE_LAZY_INIT = True
+
+# -----------------------------------------------------------------------------
+# predefined function/arg sizes, handy sometimes, but not complete...
+
+defs_precalc = {
+    "glColor3bv": {0: 3},
+    "glColor4bv": {0: 4},
+
+    "glColor3ubv": {0: 3},
+    "glColor4ubv": {0: 4},
+
+    "glColor4usv": {0: 3},
+    "glColor4usv": {0: 4},
+
+    "glColor3fv": {0: 3},
+    "glColor4fv": {0: 4},
+
+    "glColor3dv": {0: 3},
+    "glColor4dv": {0: 4},
+    
+    "glVertex2fv": {0: 2},
+    "glVertex3fv": {0: 3},
+    "glVertex4fv": {0: 4},
+
+    "glEvalCoord1fv": {0: 1},
+    "glEvalCoord1dv": {0: 1},
+    "glEvalCoord2fv": {0: 2},
+    "glEvalCoord2dv": {0: 2},
+    
+    "glRasterPos2dv": {0: 2},
+    "glRasterPos3dv": {0: 3},
+    "glRasterPos4dv": {0: 4},
+    
+    "glRasterPos2fv": {0: 2},
+    "glRasterPos3fv": {0: 3},
+    "glRasterPos4fv": {0: 4},
+    
+    "glRasterPos2sv": {0: 2},
+    "glRasterPos3sv": {0: 3},
+    "glRasterPos4sv": {0: 4},
+    
+    "glTexCoord2fv": {0: 2},
+    "glTexCoord3fv": {0: 3},
+    "glTexCoord4fv": {0: 4},
+    
+    "glTexCoord2dv": {0: 2},
+    "glTexCoord3dv": {0: 3},
+    "glTexCoord4dv": {0: 4},
+    
+    "glNormal3fv": {0: 3},
+    "glNormal3dv": {0: 3},
+    "glNormal3bv": {0: 3},
+    "glNormal3iv": {0: 3},
+    "glNormal3sv": {0: 3},
+}
+
+# -----------------------------------------------------------------------------
+
+import sys
+
+if 0:
+    # Examples with LLVM as the root dir: '/dsk/src/llvm'
+    
+    # path containing 'clang/__init__.py'
+    CLANG_BIND_DIR = "/dsk/src/llvm/tools/clang/bindings/python"
+    
+    # path containing libclang.so
+    CLANG_LIB_DIR = "/opt/llvm/lib"
+else:
+    import os
+    CLANG_BIND_DIR = os.environ.get("CLANG_BIND_DIR")
+    CLANG_LIB_DIR = os.environ.get("CLANG_LIB_DIR")
+    
+    if CLANG_BIND_DIR is None:
+        print("$CLANG_BIND_DIR python binding dir not set")
+    if CLANG_LIB_DIR is None:
+        print("$CLANG_LIB_DIR clang lib dir not set")
+
+sys.path.append(CLANG_BIND_DIR)
+
+import clang
+import clang.cindex
+from clang.cindex import (CursorKind,
+                          TypeKind,
+                          TokenKind)
+
+clang.cindex.Config.set_library_path(CLANG_LIB_DIR)
+
+index = clang.cindex.Index.create()
+
+args = sys.argv[2:]
+# print(args)
+
+tu = index.parse(sys.argv[1], args)
+print('Translation unit: %s' % tu.spelling)
+
+# -----------------------------------------------------------------------------
+
+
+def function_parm_wash_tokens(parm):
+    # print(parm.kind)
+    assert parm.kind in (CursorKind.PARM_DECL,
+                         CursorKind.VAR_DECL,  # XXX, double check this
+                         CursorKind.FIELD_DECL,
+                         )
+    
+    """
+    Return tolens without trailing commads and 'const'
+    """
+
+    tokens = [t for t in parm.get_tokens()]
+    if not tokens:
+        return tokens
+    
+    #if tokens[-1].kind == To
+    # remove trailing char
+    if tokens[-1].kind == TokenKind.PUNCTUATION:
+        if tokens[-1].spelling in (",", ")", ";"):
+            tokens.pop()
+        #else:
+        #    print(tokens[-1].spelling)
+
+    t_new = []
+    for t in tokens:
+        t_kind = t.kind
+        t_spelling = t.spelling
+        ok = True
+        if t_kind == TokenKind.KEYWORD:
+            if t_spelling in ("const", "restrict", "volatile"):
+                ok = False
+            elif t_spelling.startswith("__"):
+                ok = False  # __restrict
+        elif t_kind in (TokenKind.COMMENT, ):
+            ok = False
+            
+            # Use these
+        elif t_kind in (TokenKind.LITERAL,
+                        TokenKind.PUNCTUATION,
+                        TokenKind.IDENTIFIER):
+            # use but ignore
+            pass
+        
+        else:
+            print("Unknown!", t_kind, t_spelling)
+        
+        # if its OK we will add
+        if ok:
+            t_new.append(t)
+    return t_new
+
+
+def parm_size(node_child):
+    tokens = function_parm_wash_tokens(node_child)
+    
+    # print(" ".join([t.spelling for t in tokens]))
+    
+    # NOT PERFECT CODE, EXTRACT SIZE FROM TOKENS
+    if len(tokens) >= 3:  # foo [ 1 ]
+        if      ((tokens[-3].kind == TokenKind.PUNCTUATION and tokens[-3].spelling == "[") and
+                 (tokens[-2].kind == TokenKind.LITERAL and tokens[-2].spelling.isdigit()) and
+                 (tokens[-1].kind == TokenKind.PUNCTUATION and tokens[-1].spelling == "]")):
+            # ---
+            return int(tokens[-2].spelling)
+    return -1
+
+
+def function_get_arg_sizes(node):
+    # Return a dict if (index: size) items
+    # {arg_indx: arg_array_size, ... ]
+    arg_sizes = {}
+
+    if 1:  # node.spelling == "BM_vert_create", for debugging
+        node_parms = [node_child for node_child in node.get_children()
+                      if node_child.kind == CursorKind.PARM_DECL]
+
+        for i, node_child in enumerate(node_parms):
+
+            # print(node_child.kind, node_child.spelling)
+            #print(node_child.type.kind, node_child.spelling)  # TypeKind.POINTER
+            
+            if node_child.type.kind == TypeKind.POINTER:
+                pointee = node_child.type.get_pointee()
+                if pointee.is_pod():
+                    size = parm_size(node_child)
+                    if size != -1:
+                        arg_sizes[i] = size
+
+    return arg_sizes
+
+
+# -----------------------------------------------------------------------------
+_defs = {}
+
+
+def lookup_function_size_def(func_id):
+    if USE_LAZY_INIT:
+        result = _defs.get(func_id, {})
+        if type(result) != dict:
+            result = _defs[func_id] = function_get_arg_sizes(result)
+        return result
+    else:
+        return _defs.get(func_id, {})
+
+# -----------------------------------------------------------------------------
+
+
+def file_check_arg_sizes(tu):
+    
+    # main checking function
+    def validate_arg_size(node):
+        """
+        Loop over args and validate sizes for args we KNOW the size of.
+        """
+        assert node.kind == CursorKind.CALL_EXPR
+        
+        if 0:
+            print("---",
+                  " <~> ".join(
+                  [" ".join([t.spelling for t in C.get_tokens()])
+                  for C in node.get_children()]
+                  ))
+        # print(node.location)
+        
+        # first child is the function call, skip that.
+        children = list(node.get_children())
+
+        if not children:
+            return  # XXX, look into this, happens on C++
+        
+        func = children[0]
+        
+        # get the func declaration!
+        # works but we can better scan for functions ahead of time.
+        if 0:
+            func_dec = func.get_definition()
+            if func_dec:
+                print("FD", " ".join([t.spelling for t in func_dec.get_tokens()]))
+            else:
+                # HRMP'f - why does this fail?
+                print("AA", " ".join([t.spelling for t in node.get_tokens()]))
+        else:
+            args_size_definition = ()  # dummy
+            
+            # get the key
+            tok = list(func.get_tokens())
+            if tok:
+                func_id = tok[0].spelling
+                args_size_definition = lookup_function_size_def(func_id)
+        
+        if not args_size_definition:
+            return
+
+        children = children[1:]
+        for i, node_child in enumerate(children):
+            children = list(node_child.get_children())
+            
+            # skip if we dont have an index...
+            size_def = args_size_definition.get(i, -1)
+
+            if size_def == -1:
+                continue
+            
+            #print([c.kind for c in children])
+            # print(" ".join([t.spelling for t in node_child.get_tokens()]))
+            
+            if len(children) == 1:
+                arg = children[0]
+                if arg.kind in (CursorKind.DECL_REF_EXPR,
+                                CursorKind.UNEXPOSED_EXPR):
+
+                    if arg.type.kind == TypeKind.POINTER:
+                        dec = arg.get_definition()
+                        if dec:
+                            size = parm_size(dec)
+                            
+                            # size == 0 is for 'float *a'
+                            if size != -1 and size != 0:
+                                
+                                # nice print!
+                                if 0:
+                                    print("".join([t.spelling for t in func.get_tokens()]),
+                                          i,
+                                          " ".join([t.spelling for t in dec.get_tokens()]))
+
+                                # testing
+                                # size_def = 100
+                                if size < size_def and size != 1:
+                                    location = node.location
+                                    print("%s:%d:%d: argument %d is size %d, should be %d" %
+                                          (location.file,
+                                           location.line,
+                                           location.column,
+                                           i + 1, size, size_def
+                                           ))
+
+    # we dont really care what we are looking at, just scan entire file for
+    # function calls.
+
+    def recursive_func_call_check(node):
+        if node.kind == CursorKind.CALL_EXPR:
+            validate_arg_size(node)
+
+        for c in node.get_children():
+            recursive_func_call_check(c)
+
+    recursive_func_call_check(tu.cursor)
+
+
+# -- first pass, cache function definitions sizes
+
+# PRINT FUNC DEFINES
+def recursive_arg_sizes(node, ):
+    # print(node.kind, node.spelling)
+    if node.kind == CursorKind.FUNCTION_DECL:
+        if USE_LAZY_INIT:
+            args_sizes = node
+        else:
+            args_sizes = function_get_arg_sizes(node)
+        #if args_sizes:
+        #    print(node.spelling, args_sizes)
+        _defs[node.spelling] = args_sizes
+        # print("adding", node.spelling)
+    for c in node.get_children():
+        recursive_arg_sizes(c)
+# cache function sizes
+recursive_arg_sizes(tu.cursor)
+_defs.update(defs_precalc)
+
+# --- second pass, check against def's
+file_check_arg_sizes(tu)

blender/build_files/cmake/cmake_qtcreator_project.py

 
         qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
         f = open(qtc_cfg, 'w')
-        f.write("// ADD PREDEFINED MACROS HERE!\n")
+        f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME)
+        qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME)
+        if os.path.exists(qtc_custom_cfg):
+            fc = open(qtc_custom_cfg, 'r')
+            f.write(fc.read())
+            fc.close()
+            f.write("\n")
         defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
         if sys.platform != "win32":
             defines_final += cmake_compiler_defines()

blender/build_files/cmake/cmake_static_check_clang_array.py

+#!/usr/bin/env python3.2
+
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+import project_source_info
+import subprocess
+import sys
+import os
+
+CHECKER_IGNORE_PREFIX = [
+    "extern",
+    "intern/moto",
+    "blender/intern/opennl",
+    ]
+
+CHECKER_BIN = "python2"
+
+CHECKER_ARGS = [
+    os.path.join(os.path.dirname(__file__), "clang_array_check.py"),
+    # not sure why this is needed, but it is.
+    "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
+    ]
+
+
+def main():
+    source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
+
+    check_commands = []
+    for c, inc_dirs, defs in source_info:
+        cmd = ([CHECKER_BIN] +
+                CHECKER_ARGS +
+               [c] +
+               [("-I%s" % i) for i in inc_dirs] +
+               [("-D%s" % d) for d in defs]
+               )
+
+        check_commands.append((c, cmd))
+
+    process_functions = []
+
+    def my_process(i, c, cmd):
+        percent = 100.0 * (i / (len(check_commands) - 1))
+        percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
+
+        sys.stdout.flush()
+        sys.stdout.write("%s " % percent_str)
+
+        return subprocess.Popen(cmd)
+
+    for i, (c, cmd) in enumerate(check_commands):
+        process_functions.append((my_process, (i, c, cmd)))
+
+    project_source_info.queue_processes(process_functions)
+
+
+if __name__ == "__main__":
+    main()

blender/build_files/cmake/cmake_static_check_cppcheck.py

 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
+    "blender/intern/opennl",
     ]
 
 CHECKER_BIN = "cppcheck"
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
-              )
+               )
 
         check_commands.append((c, cmd))
 

blender/build_files/cmake/cmake_static_check_smatch.py

 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
+    "blender/intern/opennl",
     ]
 
 CHECKER_BIN = "smatch"
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
-              )
+               )
 
         check_commands.append((c, cmd))
 

blender/build_files/cmake/cmake_static_check_sparse.py

 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
+    "blender/intern/opennl",
     ]
 
 CHECKER_BIN = "sparse"
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
-              )
+               )
 
         check_commands.append((c, cmd))
 

blender/build_files/cmake/cmake_static_check_splint.py

 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
+    "blender/intern/opennl",
     ]
 
 CHECKER_BIN = "splint"
                [c] +
                [("-I%s" % i) for i in inc_dirs] +
                [("-D%s" % d) for d in defs]
-              )
+               )
 
         check_commands.append((c, cmd))
 

blender/build_files/cmake/config/blender_lite.cmake

 
 set(WITH_BUILDINFO           OFF CACHE FORCE BOOL)
 set(WITH_BULLET              OFF CACHE FORCE BOOL)
+set(WITH_CODEC_AVI           OFF CACHE FORCE BOOL)
 set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
 set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
 set(WITH_CYCLES              OFF CACHE FORCE BOOL)

blender/build_files/cmake/macros.cmake

 		link_directories(${PCRE_LIBPATH})
 		link_directories(${EXPAT_LIBPATH})
 	endif()
+	if(WITH_LLVM)
+		link_directories(${LLVM_LIB_DIR})
+	endif()
 	if(WITH_MEM_JEMALLOC)
 		link_directories(${JEMALLOC_LIBPATH})
 	endif()
 	if(WITH_CYCLES_OSL)
 		target_link_libraries(${target} ${OSL_LIBRARIES})
 	endif()
+	if(WITH_LLVM)
+		target_link_libraries(${target} ${LLVM_LIBRARY})
+	endif()
 	if(WIN32 AND NOT UNIX)
 		target_link_libraries(${target} ${PTHREADS_LIBRARIES})
 	endif()

blender/build_files/cmake/project_source_info.py

     print("running make with --dry-run ...")
     process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
                                 stdout=subprocess.PIPE,
-                                )
+                               )
 
     while process.poll():
         time.sleep(1)

blender/build_files/package_spec/rpm/blender.spec.in

 %defattr(-,root,root,-)
 %{_bindir}/%{name}
 %{_datadir}/%{name}/%{blender_api}/datafiles/fonts
+%{_datadir}/%{name}/%{blender_api}/datafiles/colormanagement
 %{_datadir}/%{name}/%{blender_api}/scripts
 %{_datadir}/icons/hicolor/*/apps/%{name}.*
 %{_datadir}/applications/%{name}.desktop

blender/build_files/scons/config/win32-mingw-config.py

 PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
 
 ## DISABLED, causes linking errors!
-## for re-distrobution, so users dont need mingw installed
+## for re-distribution, so users dont need mingw installed
 # PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
 
 BF_DEBUG = False

blender/build_files/scons/config/win64-mingw-config.py

 PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
 
 ## DISABLED, causes linking errors!
-## for re-distrobution, so users dont need mingw installed
+## for re-distribution, so users dont need mingw installed
 # PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
 
 BF_DEBUG = False

blender/doc/guides/interface_API.txt

 - It works with only OpenGL calls, for the full 100%. This means that it has some quirks
   built-in to work with all OS's and OpenGL versions. Especially frontbuffer drawing is 
   a continuous point of attention. Buttons can be drawn with any window matrix. However,
-  errors can still occor when buttons are created in windows with non-standard glViewports.
+  errors can still occur when buttons are created in windows with non-standard glViewports.
   
 - The code was written to replace the old 1.8 button system, but under high pressure. Quite
   some button methods from the old system were copied for that reason.
 All GUI elements are collected in uiBlocks, which in turn are linked together in a list that's 
 part of a Blender Area-window.
 
-	uiBlock *block= uiNewBlock(&curarea->uiblocks, "stuff", UI_EMBOSSX, UI_HELV, curarea->win);
+	uiBlock *block = uiNewBlock(&curarea->uiblocks, "stuff", UI_EMBOSSX, UI_HELV, curarea->win);
 
 The next code example makes a new block, and puts it in the list of blocks of the current active 
 Area:
 void uiAutoBlock(uiBlock *block, float minx, float miny, float sizex, float sizey, UI_BLOCK_ROWS)
 
 	Sets the buttons in this block to automatically align, and fit within boundaries. 
-	Internally it allows multiple collums or rows as well. Only 'row order' has been implemented.
+	Internally it allows multiple colums or rows as well. Only 'row order' has been implemented.
 	The uiDefBut definitions don't need coordinates as input here, but instead:
 	- first value (x1) to indicate row number
 	- width and height values (if filled in) will be used to define a relative width/height.
 			without returnvalues, the first item gets value 0 (incl. title!)
 	Example: "Do something %t| turn left %2| turn right %1| nothing %0"
 	
-11.	COL
+11.	COLOR
 	A special button that only visualizes a RGB value
 	In 'retval' you can put a code, which is used to identify for sliders if it needs
 	redraws while using the sliders. Check button '5'.
 			float min, float max, float a1, float a2,  char *tip)
 
 	Same syntax and types available as previous uiDefBut, but now with an icon code 
-	instead of a name. THe icons are numbered in resources.c
+	instead of a name. The icons are numbered in resources.c
 
 uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, 
 			short x1, short y1, short x2, short y2, float *poin, 
 	static uiBlock *info_file_importmenu(void *arg_unused)
 	{
 		uiBlock *block;
-		short yco= 0, xco = 20;
+		short yco = 0, xco = 20;
 	
-		block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSW, UI_HELV, G.curscreen->mainwin);
+		block = uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSW, UI_HELV, G.curscreen->mainwin);
 		uiBlockSetXOfs(block, -40);  // offset to parent button
 	
 		/* flags are defines */
 		uiDefButS(block, TOG|BIT|2, 0, "Two Sided", xco, yco-=20, 75, 19, &U.vrmlflag, 0.0, 0.0, 0, 0, "");
 	
 		uiBlockSetDirection(block, UI_RIGHT);
-		uiTextBoundsBlock(block, 50);	// checks for fontsize
+		uiTextBoundsBlock(block, 50);  /* checks for fontsize */
 
 		return block;
 	}

blender/doc/manpage/blender.1

-.TH "BLENDER" "1" "July 19, 2012" "Blender Blender 2\&.63 (sub 14)"
+.TH "BLENDER" "1" "October 04, 2012" "Blender Blender 2\&.64 (sub 0)"
 
 .SH NAME
 blender \- a 3D modelling and rendering package
 http://www.blender.org
 .SH OPTIONS
 
-Blender 2.63 (sub 14)
+Blender 2.64 (sub 0)
 Usage: blender [args ...] [file] [args ...]
 .br
 .SS "Render Options:"

blender/doc/python_api/rst/bge.logic.rst

 Game Logic (bge.logic)
 ======================
 
-*****
-Intro
-*****
+************
+Introduction
+************
 
 Module to access logic functions, imported automatically into the python controllers namespace.
 

blender/doc/python_api/rst/bge.types.rst

 
 .. module:: bge.types
 
+************
+Introduction
+************
+
+This module contains the classes that appear as instances in the Game Engine. A
+script must interact with these classes if it is to affect the behaviour of
+objects in a game.
+
+The following example would move an object (i.e. an instance of
+:class:`KX_GameObject`) one unit up.
+
+.. code-block:: python
+
+   # bge.types.SCA_PythonController
+   cont = bge.logic.getCurrentController()
+
+   # bge.types.KX_GameObject
+   obj = cont.owner
+   obj.worldPosition.z += 1
+
+To run the code, it could be placed in a Blender text block and executed with
+a :class:`SCA_PythonController` logic brick.
+
+*****
+Types