Commits

Dean Giberson committed c62f1f4 Merge

Merge remote-tracking branch 'upstream/master'

  • Participants
  • Parent commits 29079d8, d2e8746

Comments (0)

Files changed (380)

File blender/CMakeLists.txt

 		set(OSX_SYSTEM unsupported)
 	endif()
 	message(STATUS "Detected system-version: " ${OSX_SYSTEM})
-	
-	if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
-			set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE) # 10.6 is our min. target, if you use higher sdk, weak linking happens - with 10.5 we have still not solved problems, build those with 10.5.sdk for now !!!
-	endif()
 
 	if(${CMAKE_GENERATOR} MATCHES "Xcode")
 	
-		##### workaround for actual official cmake incompatibility with xcode 4.3 #####
+		##### cmake incompatibility with xcode  4.3 and higher #####
 		if(${XCODE_VERSION} MATCHES '') # cmake fails due looking for xcode in the wrong path, thus will be empty var
-			message("Official cmake does not yet support Xcode 4.3, get a patched version here: http://www.jensverwiebe.de/Blender/CMake%202.8-7patched.zip")
+			message(FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher")
 		endif()
-		### end workaround for actual official cmake incompatibility with xcode 4.3 ###
+		### end cmake incompatibility with xcode 4.3 and higher ###
 		
 		if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
 			# Xcode 4 defaults to the Apple LLVM Compiler.
 	endif()
 	
 	message(STATUS "Detected Xcode-version: " ${XCODE_VERSION})
+
+	if(${XCODE_VERSION} VERSION_LESS 4.3)
+		set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE)  # use guaranteed existing sdk
+	else()
+		# note: i don't use xcode-select path on purpose, cause also /Applications/Xcode.app would be allowed
+		# absolute pathes are more foolproof here !
+		set(OSX_SYSROOT_PREFIX /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform)
+		set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk
+		set(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
+	endif()
 	
+	if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+			set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "" FORCE) # 10.5 is our min. target, if you use higher sdk, weak linking happens
+	endif()
+	
+	if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
+		# force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else ( cmake bug ? )
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+		add_definitions ("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+	endif()
+
 	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)
 	message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
 
-if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK OR WITH_GAMEENGINE))
-	message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG/WITH_GAMEENGINE require WITH_AUDASPACE")
+if(NOT WITH_AUDASPACE)
+	if(WITH_OPENAL)
+		message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
+	endif()
+	if(WITH_JACK)
+		message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
+	endif()
+	if(WITH_GAMEENGINE)
+		message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
+	endif()
 endif()
 
 if(NOT WITH_SDL AND WITH_GHOST_SDL)
-	message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL to be ON")
+	message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL")
 endif()
 
 if(WITH_IMAGE_REDCODE AND ((NOT WITH_IMAGE_OPENJPEG) OR (NOT WITH_CODEC_FFMPEG)))
 	set(WITH_OPENIMAGEIO ON)
 endif()
 
-# auto enable boost for cycles, booleans or audaspace
-if(WITH_CYCLES OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE)
+# auto enable boost for cycles, booleans, audaspace or i18n
+if(WITH_CYCLES OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
 	set(WITH_BOOST ON)
 endif()
 
 # auto enable llvm for cycles_osl
-if(WITH_CYCLES_OSL)
+if(WITH_CYCLES_OSL AND NOT WIN32)
 	set(WITH_LLVM ON CACHE BOOL "ON" FORCE)
 endif()
 
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
 	endif()
 
-	if(WITH_INTERNATIONAL)
-		find_library(INTL_LIBRARY
-			NAMES intl
-			PATHS
-			/sw/lib
-		)
-
-		find_library(ICONV_LIBRARY
-			NAMES iconv
-			PATHS
-			/sw/lib
-		)
-		mark_as_advanced(
-			ICONV_LIBRARY
-			INTL_LIBRARY
-		)
-
-		if(INTL_LIBRARY AND ICONV_LIBRARY)
-			set(GETTEXT_LIBRARIES ${INTL_LIBRARY} ${ICONV_LIBRARY})
-		endif()
-	endif()
-
 	if(WITH_FFTW3)
 		find_package(Fftw3)
 		if(NOT FFTW3_FOUND)
 			else()
 				set(Boost_USE_MULTITHREADED ON)
 			endif()
-			find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
+			set(__boost_packages filesystem regex system thread)
+			if (WITH_INTERNATIONAL)
+				list(APPEND __boost_packages locale)
+			endif()
+			find_package(Boost 1.34 COMPONENTS ${__boost_packages})
 			mark_as_advanced(Boost_DIR)  # why doesnt boost do this?
 		endif()
 
 		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)
+		if(EXISTS "${LLVM_DIRECTORY}/bin/llvm-config")
 			set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
 		else()
 			set(LLVM_CONFIG llvm-config)
 		                OUTPUT_VARIABLE LLVM_LIB_DIR
 		                OUTPUT_STRIP_TRAILING_WHITESPACE)
 		find_library(LLVM_LIBRARY
-		             NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
+		             NAMES LLVMAnalysis # 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}")
 		
 	add_definitions(-DWIN32)
 
-	if(WITH_INTERNATIONAL)
-		set(ICONV ${LIBDIR}/iconv)
-		set(ICONV_INCLUDE_DIRS ${ICONV}/include)
-		set(ICONV_LIBRARIES iconv)
-		set(ICONV_LIBPATH ${ICONV}/lib)
-	endif()
-
 	set(JPEG "${LIBDIR}/jpeg")
 	set(JPEG_INCLUDE_DIR "${JPEG}/include")
 	set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
 		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})
 		find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
 		find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
 		set(CXX_WARNINGS "${_WARNINGS}")
 		unset(_WARNINGS)
 
-		if(WITH_INTERNATIONAL)
-			set(GETTEXT ${LIBDIR}/gettext)
-			set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
-			set(GETTEXT_LIBPATH ${GETTEXT}/lib)
-			set(GETTEXT_LIBRARIES gnu_gettext)
-		endif()
-		
 		if(WITH_MOD_CLOTH_ELTOPO)
 			set(LAPACK ${LIBDIR}/lapack)
 			# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
 				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})
+			if(WITH_INTERNATIONAL)
+				set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+					optimized libboost_locale-${BOOST_POSTFIX}
+					debug libboost_locale-${BOOST_DEBUG_POSTFIX})
+			endif(WITH_INTERNATIONAL)
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
 		endif()
 			
 			set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
 			set(OPENIMAGEIO_LIBRARIES OpenImageIO)
 			set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
-			set(OPENIMAGEIO_DEFINITIONS)
+			set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
 		endif()
 
 		if(WITH_OPENCOLORIO)
 			set(OPENCOLORIO_DEFINITIONS)
 		endif()
 
+
 		set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
 
 		# MSVC only, Mingw doesnt need
 
 		add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
 
-
 		add_definitions(-DFREE_WINDOWS)
 
-		if(WITH_INTERNATIONAL)
-			set(GETTEXT ${LIBDIR}/gettext)
-			set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
-			set(GETTEXT_LIBPATH ${GETTEXT}/lib)
-			set(GETTEXT_LIBRARIES intl)
-		endif()
-		
 		set(PNG "${LIBDIR}/png")
 		set(PNG_INCLUDE_DIR "${PNG}/include")
 		set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
 				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})
+			if(WITH_INTERNATIONAL)
+				set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+					optimized boost_locale-${BOOST_POSTFIX}
+					debug boost_locale-${BOOST_DEBUG_POSTFIX}) 
+			endif()
 			set(BOOST_LIBPATH ${BOOST}/lib)
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
 		endif()
 		set(WITH_LIBS10.5 ON CACHE BOOL "Use 10.5 libs" FORCE) # valid also for 10.6/10.7
 	endif()
 
-	if(${XCODE_VERSION} VERSION_LESS 4.3)
-		set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE)  # use guaranteed existing sdk
-	else()
-		# note: i don't use xcode-select path on purpose, cause also /Applications/Xcode.app would be allowed
-		# absolute pathes are more foolproof here !
-		set(OSX_SYSROOT_PREFIX /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform)
-		set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk
-		set(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
-	endif()
-	
 	if(WITH_LIBS10.5)
 		set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
 	else()
 	endif()
 
 	if(WITH_JACK)
-		set(JACK /usr)
-		set(JACK_INCLUDE_DIRS ${JACK}/include/jack)
-		set(JACK_LIBRARIES jack)
-		set(JACK_LIBPATH ${JACK}/lib)
+		find_library(JACK_FRAMEWORK
+			NAMES jackmp
+		)
+		set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
+		if(NOT JACK_FRAMEWORK)
+			set(WITH_JACK OFF)
+		endif()
 	endif()
 
 	if(WITH_CODEC_SNDFILE)
 		set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
 	endif()
 
-	if(WITH_INTERNATIONAL)
-		set(GETTEXT ${LIBDIR}/gettext)
-		set(GETTEXT_INCLUDE_DIRS "${GETTEXT}/include")
-		set(GETTEXT_LIBRARIES intl iconv)
-		set(GETTEXT_LIBPATH ${GETTEXT}/lib)
-	endif()
-
 	if(WITH_FFTW3)
 		set(FFTW3 ${LIBDIR}/fftw3)
 		set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
 		if(WITH_INPUT_NDOF)
 			# This thread it *should* work and check the framework - campbell
 			# http://www.cmake.org/pipermail/cmake/2005-December/007740.html
-			find_library(3D_CONNEXION_CLIENT_LIBRARY
+			find_library(3DCONNEXION_CLIENT_FRAMEWORK
 				NAMES 3DconnexionClient
 			)
-			if(NOT 3D_CONNEXION_CLIENT_LIBRARY)
+			if(NOT 3DCONNEXION_CLIENT_FRAMEWORK)
 				set(WITH_INPUT_NDOF OFF)
 			endif()
 
 			endif()
 		endif()
 
+	if(WITH_JACK)
+		set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -weak_framework jackmp")
+	endif()
+
 	else()
 		set(PLATFORM_CFLAGS "-pipe -funsigned-char")
 		set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
 		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_INTERNATIONAL)
+			list(APPEND BOOST_LIBRARIES boost_locale-mt)
+			set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale needs it !
+		endif()
 		set(BOOST_LIBPATH ${BOOST}/lib)
 		set(BOOST_DEFINITIONS)
 	endif()
 		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)
+		if(EXISTS "${LLVM_DIRECTORY}/bin/llvm-config")
 			set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
 		else()
 			set(LLVM_CONFIG llvm-config)
 		                OUTPUT_VARIABLE LLVM_LIB_DIR
 		                OUTPUT_STRIP_TRAILING_WHITESPACE)
 		find_library(LLVM_LIBRARY
-		             NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
+		             NAMES LLVMAnalysis # 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(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(WITH_CYCLES_OSL AND NOT WIN32)
 		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()
 
+if(WITH_INTERNATIONAL)
+	if(NOT WITH_BOOST)
+		message(FATAL_ERROR "Internationalization reqires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_INTERNATIONAL")
+	endif()
+endif()
 
 # See TEST_SSE_SUPPORT() for how this is defined.
 

File blender/GNUmakefile

 	@echo "  * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
 	@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)"
-	@echo "  * check_spelling_c   - check for spelling errors (OSL only)"
-	@echo "  * check_spelling_osl - check for spelling errors (C/C++ only)"
-	@echo "  * check_spelling_py  - check for spelling errors (Python only)"
+	@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)"
+	@echo "  * check_spelling_c     - check for spelling errors (OSL only)"
+	@echo "  * check_spelling_c_qtc - same as check_spelling_c but outputs QtCreator tasks format"
+	@echo "  * check_spelling_osl   - check for spelling errors (C/C++ only)"
+	@echo "  * check_spelling_py    - check for spelling errors (Python only)"
 	@echo ""
 	@echo "Utilities (not associated with building blender)"
 	@echo "  * tbz      - create a compressed svn export 'blender_archive.tar.bz2'"
 
 check_cppcheck:
 	$(CMAKE_CONFIG)
-	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
+	cd $(BUILD_DIR) ; \
+	python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
 
 check_clang_array:
 	$(CMAKE_CONFIG)
-	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
+	cd $(BUILD_DIR) ; \
+	python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
 
 check_splint:
 	$(CMAKE_CONFIG)
-	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
+	cd $(BUILD_DIR) ; \
+	python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
 
 check_sparse:
 	$(CMAKE_CONFIG)
-	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
+	cd $(BUILD_DIR) ; \
+	python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
 
 check_smatch:
 	$(CMAKE_CONFIG)
-	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py
+	cd $(BUILD_DIR) ; \
+	python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py
 
 check_spelling_py:
-	cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/release/scripts
+	cd $(BUILD_DIR) ; \
+	PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/release/scripts
 
 check_spelling_c:
-	cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source
+	cd $(BUILD_DIR) ; \
+	PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source
+
+check_spelling_c_qtc:
+	cd $(BUILD_DIR) ; USE_QTC_TASK=1 \
+	PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source > \
+	$(BLENDER_DIR)/check_spelling_c.tasks
 
 check_spelling_osl:
 	cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/intern/cycles/kernel/osl

File blender/SConstruct

 # 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"
+    found_python_h = found_pyconfig_h = False
+    for bf_python_inc in env.subst('${BF_PYTHON_INC}').split():
+        py_h = os.path.join(Dir(bf_python_inc).abspath, "Python.h")
+        if os.path.exists(py_h):
+            found_python_h = True
+        py_h = os.path.join(Dir(bf_python_inc).abspath, "pyconfig.h")
+        if os.path.exists(py_h):
+            found_pyconfig_h = True
+
+    if not (found_python_h and found_pyconfig_h):
+        print("\nMissing: Python.h and/or pyconfig.h in\"" + env.subst('${BF_PYTHON_INC}') + "\",\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}') + "\"")
+              "to valid python include path(s).\n Containing "
+              "Python.h and pyconfig.h for python version \"" + env.subst('${BF_PYTHON_VERSION}') + "\"")
 
         Exit()
-    del py_h
 
 
 if not os.path.isdir ( B.root_build_dir):
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
     dllsources = []
 
-    if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
-        # For MinGW and linuxcross static linking will be used
-        dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
-
     dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
     # Used when linking to libtiff was dynamic
     # keep it here until compilation on all platform would be ok

File blender/build_files/build_environment/install_deps.sh

+#!/bin/bash
+
+DISTRO=""
+SRC="$HOME/src/blender-deps"
+CWD=$PWD
+
+THREADS=`cat /proc/cpuinfo | grep cores | uniq | sed -e "s/.*: *\(.*\)/\\1/"`
+
+PYTHON_VERSION="3.3.0"
+BOOST_VERSION="1_51_0"
+OIIO_VERSION="1.1.0"
+OCIO_VERSION="1.0.7"
+FFMPEG_VERSION="1.0"
+_ffmpeg_list_sep=";"
+
+# XXX Looks like ubuntu has libxvidcore4-dev, while debian has libxvidcore-dev...
+HASXVID=false
+XVIDDEV=""
+HASVPX=false
+HASMP3LAME=false
+HASX264=false
+HASOPENJPEG=false
+HASSCHRO=false
+
+# Switch to english language, else some things (like check_package_DEB()) won't work!
+LANG_BACK=$LANG
+LANG=""
+export LANG
+
+ERROR() {
+  echo "${@}"
+}
+
+INFO() {
+  echo "${@}"
+}
+
+# Return 1 if $1 >= $2, else 0.
+# $1 and $2 should be version numbers made of numbers only.
+version_ge() {
+  if [ $(echo -e "$1\n$2" | sort --version-sort | head --lines=1) = "$1" ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
+# Return 1 if $1 is into $2 (e.g. 3.3.2 is into 3.3, but not 3.3.0 or 3.3.5)
+# $1 and $2 should be version numbers made of numbers only.
+# $1 should be at least as long as $2!
+version_match() {
+  backIFS=$IFS
+  IFS='.'
+
+  # Split both version numbers into their numeric elements.
+  arr1=( $1 )
+  arr2=( $2 )
+
+  ret=0
+
+  count1=${#arr1[@]}
+  count2=${#arr2[@]}
+  if [ $count1 -ge $count2 ]; then
+    ret=1
+    for (( i=0; $i < $count2; i++ ))
+    do
+      if [ $(( 10#${arr1[$i]} )) -ne $(( 10#${arr2[$i]} )) ]; then
+        ret=0
+        break
+      fi
+    done
+  fi
+
+  IFS=$backIFS
+  return $ret
+}
+
+detect_distro() {
+  if [ -f /etc/debian_version ]; then
+    DISTRO="DEB"
+  elif [ -f /etc/redhat-release ]; then
+    DISTRO="RPM"
+  elif [ -f /etc/SuSE-release ]; then
+    DISTRO="SUSE"
+  fi
+}
+
+prepare_opt() {
+  INFO "Ensuring /opt/lib exists and writable by us"
+  sudo mkdir -p /opt/lib
+  sudo chown $USER /opt/lib
+  sudo chmod 775 /opt/lib
+}
+
+compile_Python() {
+  if [ ! -d /opt/lib/python-$PYTHON_VERSION ]; then
+    INFO "Building Python-$PYTHON_VERSION"
+
+    prepare_opt
+
+    if [ ! -d $SRC/Python-$PYTHON_VERSION ]; then
+      mkdir -p $SRC
+      wget -c http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.bz2 -P $SRC
+
+      INFO "Unpacking Python-$PYTHON_VERSION"
+      tar -C $SRC -xf $SRC/Python-$PYTHON_VERSION.tar.bz2
+    fi
+
+    cd $SRC/Python-$PYTHON_VERSION
+
+    ./configure --prefix=/opt/lib/python-$PYTHON_VERSION --enable-ipv6 \
+        --enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
+        --with-computed-gotos --with-pymalloc
+
+    make -j$THREADS
+    make install
+    make clean
+
+    rm -f /opt/lib/python-3.3
+    ln -s python-$PYTHON_VERSION /opt/lib/python-3.3
+
+    cd $CWD
+  fi
+}
+
+compile_Boost() {
+  INFO "Building boost"
+
+  version_dots=`echo "$BOOST_VERSION" | sed -r 's/_/./g'`
+
+  if [ ! -d /opt/lib/boost-$version_dots ]; then
+    INFO "Building Boost-$version_dots"
+
+    prepare_opt
+
+    if [ ! -d $SRC/boost_$BOOST_VERSION ]; then
+      INFO "Downloading Boost-$version_dots"
+      mkdir -p $SRC
+      wget -c http://sourceforge.net/projects/boost/files/boost/$version_dots/boost_$BOOST_VERSION.tar.bz2/download \
+        -O $SRC/boost_$BOOST_VERSION.tar.bz2
+      tar -C $SRC -xf $SRC/boost_$BOOST_VERSION.tar.bz2
+    fi
+
+    cd $SRC/boost_$BOOST_VERSION
+    ./bootstrap.sh --with-libraries=system,filesystem,thread,regex,locale,date-time --prefix=/opt/lib/boost-$version_dots
+    ./b2 install
+    ./b2 --clean
+
+    rm -f /opt/lib/boost
+    ln -s boost-$version_dots /opt/lib/boost
+
+    cd $CWD
+  fi
+}
+
+compile_OCIO() {
+  if [ ! -d /opt/lib/ocio-$OCIO_VERSION ]; then
+    INFO "Building OpenColorIO-$OCIO_VERSION"
+
+    prepare_opt
+
+    if [ ! -d $SRC/OpenColorIO-$OCIO_VERSION ]; then
+        INFO "Downloading OpenColorIO-$OCIO_VERSION"
+        mkdir -p $SRC
+        wget -c http://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION \
+          -O $SRC/OpenColorIO-$OCIO_VERSION.tar.gz
+
+        INFO "Unpacking OpenColorIO-$OCIO_VERSION"
+        tar -C "$SRC" -xf $SRC/OpenColorIO-$OCIO_VERSION.tar.gz
+        mv $SRC/imageworks-OpenColorIO* $SRC/OpenColorIO-$OCIO_VERSION
+    fi
+
+    cd $SRC/OpenColorIO-$OCIO_VERSION
+    mkdir build
+    cd build
+
+    if file /bin/cp | grep -q '32-bit'; then
+      cflags="-fPIC -m32 -march=i686"
+    else
+      cflags="-fPIC"
+    fi
+
+    cmake -D CMAKE_BUILD_TYPE=Release \
+        -D CMAKE_PREFIX_PATH=/opt/lib/ocio-$OCIO_VERSION \
+        -D CMAKE_INSTALL_PREFIX=/opt/lib/ocio-$OCIO_VERSION \
+        -D CMAKE_CXX_FLAGS="$cflags" \
+        -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" \
+        ..
+
+    make -j$THREADS
+    make install
+
+    # Force linking against sttaic libs
+    rm -f /opt/lib/ocio-$OCIO_VERSION/lib/*.so*
+
+    # Additional depencencies
+    cp ext/dist/lib/libtinyxml.a /opt/lib/ocio-$OCIO_VERSION/lib
+    cp ext/dist/lib/libyaml-cpp.a /opt/lib/ocio-$OCIO_VERSION/lib
+
+    make clean
+
+    rm -f /opt/lib/ocio
+    ln -s ocio-$OCIO_VERSION /opt/lib/ocio
+
+    cd $CWD
+  fi
+}
+
+compile_OIIO() {
+  if [ ! -d /opt/lib/oiio-$OIIO_VERSION ]; then
+    INFO "Building OpenImageIO-$OIIO_VERSION"
+
+    prepare_opt
+
+    if [ ! -d $SRC/OpenImageIO-$OIIO_VERSION ]; then
+      wget -c https://github.com/OpenImageIO/oiio/tarball/Release-$OIIO_VERSION \
+          -O "$SRC/OpenImageIO-$OIIO_VERSION.tar.gz"
+
+      INFO "Unpacking OpenImageIO-$OIIO_VERSION"
+      tar -C $SRC -xf $SRC/OpenImageIO-$OIIO_VERSION.tar.gz
+      mv $SRC/OpenImageIO-oiio* $SRC/OpenImageIO-$OIIO_VERSION
+    fi
+
+    cd $SRC/OpenImageIO-$OIIO_VERSION
+    mkdir build
+    cd build
+
+    if [ -d /opt/lib/boost ]; then
+      boost_root="/opt/lib/boost"
+    else
+      boost_root="/usr"
+    fi
+
+    if file /bin/cp | grep -q '32-bit'; then
+      cflags="-fPIC -m32 -march=i686"
+    else
+      cflags="-fPIC"
+    fi
+
+    cmake -D CMAKE_BUILD_TYPE=Release \
+        -D CMAKE_PREFIX_PATH=/opt/lib/oiio-$OIIO_VERSION \
+        -D CMAKE_INSTALL_PREFIX=/opt/lib/oiio-$OIIO_VERSION \
+        -D BUILDSTATIC=ON \
+        -D CMAKE_CXX_FLAGS="$cflags" \
+        -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" \
+        -D BOOST_ROOT="$boost_root" \
+        ../src
+
+    make -j$THREADS
+    make install
+    make clean
+
+    rm -f /opt/lib/oiio
+    ln -s oiio-$OIIO_VERSION /opt/lib/oiio
+
+    cd $CWD
+  fi
+}
+
+compile_FFmpeg() {
+  if [ ! -d /opt/lib/ffmpeg-$FFMPEG_VERSION ]; then
+    INFO "Building FFmpeg-$FFMPEG_VERSION"
+
+    prepare_opt
+
+    if [ ! -d $SRC/ffmpeg-$FFMPEG_VERSION ]; then
+      INFO "Downloading FFmpeg-$FFMPEG_VERSION"
+      wget -c http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2 -P $SRC
+
+      INFO "Unpacking FFmpeg-$FFMPEG_VERSION"
+      tar -C $SRC -xf $SRC/ffmpeg-$FFMPEG_VERSION.tar.bz2
+    fi
+
+    cd $SRC/ffmpeg-$FFMPEG_VERSION
+
+    extra=""
+
+    if $HASXVID; then
+      extra="$extra --enable-libxvid"
+    fi
+
+    if $HASVPX; then
+      extra="$extra --enable-libvpx"
+    fi
+
+    if $HASMP3LAME; then
+      extra="$extra --enable-libmp3lame"
+    fi
+
+    if $HASX264; then
+      extra="$extra --enable-libx264"
+    fi
+
+    if $HASOPENJPEG; then
+      extra="$extra --enable-libopenjpeg"
+    fi
+
+    if $HASSCHRO; then
+      extra="$extra --enable-libschroedinger"
+    fi
+
+    ./configure --cc="gcc -Wl,--as-needed" --extra-ldflags="-pthread -static-libgcc" \
+        --prefix=/opt/lib/ffmpeg-$FFMPEG_VERSION --enable-static --enable-avfilter --disable-vdpau \
+        --disable-bzlib --disable-libgsm --disable-libspeex --enable-libtheora \
+        --enable-libvorbis --enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \
+        --disable-vaapi  --disable-libfaac --disable-nonfree --enable-gpl \
+        --disable-postproc --disable-x11grab  --disable-librtmp  --disable-libopencore-amrnb \
+        --disable-libopencore-amrwb --disable-libdc1394 --disable-version3  --disable-outdev=sdl \
+        --disable-outdev=alsa --disable-indev=sdl --disable-indev=alsa --disable-indev=jack \
+        --disable-indev=lavfi $extra
+
+    make -j$THREADS
+    make install
+    make clean
+
+    rm -f /opt/lib/ffmpeg
+    ln -s ffmpeg-$FFMPEG_VERSION /opt/lib/ffmpeg
+
+    cd $CWD
+  fi
+}
+
+deb_version() {
+    dpkg-query -W -f '${Version}' $1 | sed -r 's/^([0-9]\.[0-9]+).*/\1/'
+}
+
+check_package_DEB() {
+  r=`apt-cache policy $1 | grep -c 'Candidate:'`
+
+  if [ $r -ge 1 ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
+install_DEB() {
+  INFO "Installing dependencies for DEB-based distributive"
+
+  sudo apt-get update
+# XXX Why in hell? Let's let this stuff to the user's responsability!!!
+#  sudo apt-get -y upgrade
+
+  sudo apt-get install -y cmake scons gcc g++ libjpeg-dev libpng-dev libtiff-dev \
+    libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev libncurses5-dev \
+    libssl-dev liblzma-dev libreadline-dev libopenjpeg-dev libopenexr-dev libopenal-dev \
+    libglew-dev yasm libschroedinger-dev libtheora-dev libvorbis-dev libsdl1.2-dev \
+    libfftw3-dev libjack-dev python-dev patch
+
+  HASOPENJPEG=true
+  HASSCHRO=true
+
+  check_package_DEB libxvidcore-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libxvidcore-dev
+    HASXVID=true
+    XVIDDEV="libxvidcore-dev"
+  fi
+
+  check_package_DEB libxvidcore4-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libxvidcore4-dev
+    HASXVID=true
+    XVIDDEV="libxvidcore4-dev"
+  fi
+
+  check_package_DEB libmp3lame-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libmp3lame-dev
+    HASMP3LAME=true
+  fi
+
+  check_package_DEB libx264-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libx264-dev
+    HASX264=true
+  fi
+
+  check_package_DEB libvpx-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libvpx-dev
+    vpx_version=`deb_version libvpx-dev`
+    if  dpkg --compare-versions $vpx_version gt 0.9.7; then
+      if version_ge $vpx_version 0.9.7; then
+        HASVPX=true
+      fi
+    fi
+  fi
+
+  check_package_DEB libspnav-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libspnav-dev
+  fi
+
+  check_package_DEB python3.3-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y python3.3-dev
+  else
+    compile_Python
+  fi
+
+  check_package_DEB libboost-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libboost-dev
+
+    boost_version=`deb_version libboost-dev`
+
+    check_package_DEB libboost-locale$boost_version-dev
+    if [ $? -eq 0 ]; then
+      sudo apt-get install -y libboost-locale$boost_version-dev libboost-filesystem$boost_version-dev \
+        libboost-regex$boost_version-dev libboost-system$boost_version-dev libboost-thread$boost_version-dev
+    else
+      compile_Boost
+    fi
+  else
+    compile_Boost
+  fi
+
+  check_package_DEB libopencolorio-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libopencolorio-dev
+  else
+    compile_OCIO
+  fi
+
+  check_package_DEB libopenimageio-dev
+  if [ $? -eq 0 ]; then
+    sudo apt-get install -y libopenimageio-dev
+  else
+    compile_OIIO
+  fi
+
+#  XXX Debian features libav packages as ffmpeg, those are not really compatible with blender code currently :/
+#      So for now, always build our own ffmpeg.
+#  check_package_DEB ffmpeg
+#  if [ $? -eq 0 ]; then
+#    sudo apt-get install -y ffmpeg
+#    ffmpeg_version=`deb_version ffmpeg`
+#    INFO "ffmpeg version: $ffmpeg_version"
+#    if [ ! -z "$ffmpeg_version" ]; then
+#      if  dpkg --compare-versions $ffmpeg_version gt 0.7.2; then
+#        sudo apt-get install -y libavfilter-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswscale-dev
+#      else
+#        compile_FFmpeg
+#      fi
+#    fi
+#  fi
+  compile_FFmpeg
+}
+
+check_package_RPM() {
+  r=`yum info $1 | grep -c 'Summary'`
+
+  if [ $r -ge 1 ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
+check_package_version_match_RPM() {
+  v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
+
+  version_match $v $2
+  return $?
+}
+
+check_package_version_ge_RPM() {
+  v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
+
+  version_ge $v $2
+  return $?
+}
+
+install_RPM() {
+  INFO "Installing dependencies for RPM-based distributive"
+
+  sudo yum -y update
+
+  sudo yum -y install gcc gcc-c++ cmake scons libpng-devel libtiff-devel \
+    freetype-devel libX11-devel libXi-devel wget libsqlite3x-devel ncurses-devel \
+    readline-devel openjpeg-devel openexr-devel openal-soft-devel \
+    glew-devel yasm schroedinger-devel libtheora-devel libvorbis-devel SDL-devel \
+    fftw-devel lame-libs jack-audio-connection-kit-devel libspnav-devel \
+    libjpeg-devel patch python-devel
+
+  HASOPENJPEG=true
+  HASSCHRO=true
+
+  check_package_RPM x264-devel
+  if [ $? -eq 0 ]; then
+    sudo yum install -y x264-devel
+    HASX264=true
+  fi
+
+  check_package_RPM xvidcore-devel
+  if [ $? -eq 0 ]; then
+    sudo yum install -y xvidcore-devel
+    HASXVID=true
+    XVIDDEV="xvidcore-devel"
+  fi
+
+  check_package_version_ge_RPM libvpx-devel 0.9.7
+  if [ $? -eq 1 ]; then
+    sudo yum install -y libvpx-devel
+    HASVPX=true
+  fi
+
+  check_package_RPM lame-devel
+  if [ $? -eq 0 ]; then
+    sudo yum install -y lame-devel
+    HASMP3LAME=true
+  fi
+
+  check_package_version_match_RPM python3-devel 3.3
+  if [ $? -eq 1 ]; then
+    sudo yum install -y python-devel
+  else
+    compile_Python
+  fi
+
+  check_package_RPM boost-devel
+  if [ $? -eq 0 ]; then
+    sudo yum install -y boost-devel
+  else
+    compile_Boost
+  fi
+
+  check_package_RPM OpenColorIO-devel
+  if [ $? -eq 0 ]; then
+    sudo yum install -y OpenColorIO-devel
+  else
+    compile_OCIO
+  fi
+
+  check_package_RPM OpenImageIO-devel
+  if [ $? -eq 0 ]; then
+    sudo yum install -y OpenImageIO-devel
+  else
+    compile_OIIO
+  fi
+
+  # Always for now, not sure which packages should be installed
+  compile_FFmpeg
+}
+
+check_package_SUSE() {
+  r=`zypper info $1 | grep -c 'Summary'`
+
+  if [ $r -ge 1 ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
+check_package_version_SUSE() {
+  v=`zypper info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
+
+  # for now major and minor versions only (as if x.y, not x.y.z)
+  r=`echo $v | grep -c $2`
+
+  if [ $r -ge 1 ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
+install_SUSE() {
+  INFO "Installing dependencies for SuSE-based distributive"
+
+  sudo zypper --non-interactive update --auto-agree-with-licenses
+
+  sudo zypper --non-interactive install --auto-agree-with-licenses \
+    gcc gcc-c++ libSDL-devel openal-soft-devel libpng12-devel libjpeg62-devel \
+    libtiff-devel OpenEXR-devel yasm libtheora-devel libvorbis-devel cmake \
+    scons patch
+
+  check_package_version_SUSE python3-devel 3.3.
+  if [ $? -eq 0 ]; then
+    sudo zypper --non-interactive install --auto-agree-with-licenses python3-devel
+  else
+    compile_Python
+  fi
+
+  # can not see boost_locale in repo, so let's build own boost
+  compile_Boost
+
+  # this libraries are also missing in the repo
+  compile_OCIO
+  compile_OIIO
+  compile_FFmpeg
+}
+
+print_info_ffmpeglink_DEB() {
+  _packages="libtheora-dev"
+
+  if $HASXVID; then
+    _packages="$_packages $XVIDDEV"
+  fi
+
+  if $HASVPX; then
+    _packages="$_packages libvpx-dev"
+  fi
+
+  if $HASMP3LAME; then
+    _packages="$_packages libmp3lame-dev"
+  fi
+
+  if $HASX264; then
+    _packages="$_packages libx264-dev"
+  fi
+
+  if $HASOPENJPEG; then
+    _packages="$_packages libopenjpeg-dev"
+  fi
+
+  if $HASSCHRO; then
+    _packages="$_packages libschroedinger-dev"
+  fi
+
+  dpkg -L $_packages | grep -e ".*\/lib[^\/]\+\.so" | awk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
+}
+
+print_info_ffmpeglink_RPM() {
+  _packages="libtheora-devel libvorbis-devel"
+
+  if $HASXVID; then
+    _packages="$_packages $XVIDDEV"
+  fi
+
+  if $HASVPX; then
+    _packages="$_packages libvpx-devel"
+  fi
+
+  if $HASMP3LAME; then
+    _packages="$_packages lame-devel"
+  fi
+
+  if $HASX264; then
+    _packages="$_packages x264-devel"
+  fi
+
+  if $HASOPENJPEG; then
+    _packages="$_packages openjpeg-devel"
+  fi
+
+  if $HASSCHRO; then
+    _packages="$_packages schroedinger-devel"
+  fi
+
+  rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | awk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
+}
+
+print_info_ffmpeglink() {
+  # This func must only print a ';'-separated list of libs...
+  if [ -z "$DISTRO" ]; then
+    ERROR "Failed to detect distribution type"
+    exit 1
+  elif [ "$DISTRO" = "DEB" ]; then
+    print_info_ffmpeglink_DEB
+  elif [ "$DISTRO" = "RPM" ]; then
+    print_info_ffmpeglink_RPM
+  # XXX TODO!
+  else INFO "<Could not determine additional link libraries needed for ffmpeg, replace this by valid list of libs...>"
+#  elif [ "$DISTRO" = "SUSE" ]; then
+#    print_info_ffmpeglink_SUSE
+  fi
+}
+
+print_info() {
+  INFO ""
+  INFO "If you're using CMake add this to your configuration flags:"
+
+  if [ -d /opt/lib/boost ]; then
+    INFO "  -D BOOST_ROOT=/opt/lib/boost"
+    INFO "  -D Boost_NO_SYSTEM_PATHS=ON"
+  fi
+
+  if [ -d /opt/lib/ffmpeg ]; then
+    INFO "  -D WITH_CODEC_FFMPEG=ON"
+    INFO "  -D FFMPEG=/opt/lib/ffmpeg"
+    INFO "  -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;rt;`print_info_ffmpeglink`'"
+  fi
+
+  INFO ""
+  INFO "If you're using SCons add this to your user-config:"
+
+  if [ -d /opt/lib/python-3.3 ]; then
+    INFO "BF_PYTHON='/opt/lib/python-3.3'"
+    INFO "BF_PYTHON_ABI_FLAGS='m'"
+  fi
+
+  if [ -d /opt/lib/ocio ]; then
+    INFO "BF_OCIO='/opt/lib/ocio'"
+  fi
+
+  if [ -d /opt/lib/oiio ]; then
+    INFO "BF_OIIO='/opt/lib/oiio'"
+  fi
+
+  if [ -d /opt/lib/boost ]; then
+    INFO "BF_BOOST='/opt/lib/boost'"
+  fi
+
+  if [ -d /opt/lib/ffmpeg ]; then
+    INFO "BF_FFMPEG='/opt/lib/ffmpeg'"
+    _ffmpeg_list_sep=" "
+    INFO "BF_FFMPEG_LIB='avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'"
+  fi
+}
+
+# Detect distributive type used on this machine
+detect_distro
+
+if [ -z "$DISTRO" ]; then
+  ERROR "Failed to detect distribution type"
+  exit 1
+elif [ "$DISTRO" = "DEB" ]; then
+  install_DEB
+elif [ "$DISTRO" = "RPM" ]; then
+  install_RPM
+elif [ "$DISTRO" = "SUSE" ]; then
+  install_SUSE
+fi
+
+print_info
+
+# Switch back to user language.
+LANG=LANG_BACK
+export LANG

File blender/build_files/buildbot/config/user-config-glibc211-i686.py

 BF_BOOST = '/opt/lib/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
 BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
-    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
+    ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # Ocean Simulation

File blender/build_files/buildbot/config/user-config-glibc211-x86_64.py

 BF_BOOST = '/opt/lib/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
 BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
-    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
+    ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # Ocean Simulation

File blender/build_files/buildbot/config/user-config-glibc27-i686.py

 WITH_BF_STATICBOOST = True
 BF_BOOST = '/opt/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # Ocean Simulation

File blender/build_files/buildbot/config/user-config-glibc27-x86_64.py

 WITH_BF_STATICBOOST = True
 BF_BOOST = '/opt/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # Ocean Simulation

File blender/build_files/buildbot/config/user-config-player-glibc211-i686.py

 BF_BOOST = '/opt/lib/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
 BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
-    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
+    ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # JACK

File blender/build_files/buildbot/config/user-config-player-glibc211-x86_64.py

 BF_BOOST = '/opt/lib/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
 BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
-    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+    '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
+    ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # JACK

File blender/build_files/buildbot/config/user-config-player-glibc27-i686.py

 WITH_BF_STATICBOOST = True
 BF_BOOST = '/opt/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # JACK

File blender/build_files/buildbot/config/user-config-player-glibc27-x86_64.py

 WITH_BF_STATICBOOST = True
 BF_BOOST = '/opt/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # JACK

File blender/build_files/cmake/Modules/FindOpenColorIO.cmake

   /sw # Fink
   /opt/local # DarwinPorts
   /opt/csw # Blastwave
+  /opt/lib/ocio
 )
 
 FIND_PATH(OPENCOLORIO_INCLUDE_DIR

File blender/build_files/cmake/Modules/FindOpenImageIO.cmake

   /sw # Fink
   /opt/local # DarwinPorts
   /opt/csw # Blastwave
+  /opt/lib/oiio
 )
 
 FIND_PATH(OPENIMAGEIO_INCLUDE_DIR

File blender/build_files/cmake/Modules/FindPythonLibsUnix.cmake

     ${PYTHON_ROOT_DIR}
     "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
     "/opt/py${_PYTHON_VERSION_NO_DOTS}"
+    "/opt/lib/python-${PYTHON_VERSION}"
   )
 
   FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
           include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
           include/${CMAKE_LIBRARY_ARCHITECTURE}/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
       )
-      IF(NOT PYTHON_INCLUDE_CONFIG_DIR AND PYTHON_INCLUDE_DIR)
+      IF((NOT PYTHON_INCLUDE_CONFIG_DIR) AND PYTHON_INCLUDE_DIR)
         # Fallback...
-        SET(PYTHON_INCLUDE_CONFIG_DIR ${PYTHON_INCLUDE_DIR})
+        UNSET(PYTHON_INCLUDE_CONFIG_DIR CACHE)
+        SET(PYTHON_INCLUDE_CONFIG_DIR ${PYTHON_INCLUDE_DIR} CACHE PATH "")
       ENDIF()
     ENDIF()
 
         PATH_SUFFIXES
           lib64 lib
       )
-      IF(NOT PYTHON_LIBPATH AND PYTHON_LIBRARY)
+      IF((NOT PYTHON_LIBPATH) AND PYTHON_LIBRARY)
         # Fallback...
+        UNSET(PYTHON_LIBPATH CACHE)
         GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
       ENDIF()
     ENDIF()
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibsUnix  DEFAULT_MSG
     PYTHON_LIBRARY PYTHON_LIBPATH PYTHON_INCLUDE_DIR PYTHON_INCLUDE_CONFIG_DIR)
 
-
 IF(PYTHONLIBSUNIX_FOUND)
   # Assign cache items
   SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})

File blender/build_files/cmake/cmake_consistency_check.py

             '''
 
             # reset
-            sources_h[:] = []
-            sources_c[:] = []
+            del sources_h[:]
+            del sources_c[:]
 
     filen.close()
 

File blender/build_files/cmake/macros.cmake

 	if(WITH_PYTHON)  #  AND NOT WITH_PYTHON_MODULE  # WIN32 needs
 		link_directories(${PYTHON_LIBPATH})
 	endif()
-	if(WITH_INTERNATIONAL)
-		link_directories(${ICONV_LIBPATH})
-		link_directories(${GETTEXT_LIBPATH})
-	endif()
 	if(WITH_SDL)
 		link_directories(${SDL_LIBPATH})
 	endif()
 		target_link_libraries(${target} ${GLEW_LIBRARY})
 	endif()
 
-	if(WITH_INTERNATIONAL)
-		target_link_libraries(${target} ${GETTEXT_LIBRARIES})
-
-		if(WIN32 AND NOT UNIX)
-			target_link_libraries(${target} ${ICONV_LIBRARIES})
-		endif()
-	endif()
-
 	if(WITH_OPENAL)
 		target_link_libraries(${target} ${OPENAL_LIBRARY})
 	endif()

File blender/build_files/scons/config/darwin-config.py

 
 WITH_BF_INTERNATIONAL = True
 
-BF_GETTEXT = LIBDIR + '/gettext'