Make deps: Fixes for macOS platform

Set of fixes which had to be made in order to have dependencies built
on own laptop:

- Require bison as a dependent software. It is required by ISPC.

  On macOS it is required to be installed via Homebrew. This is because
  Bison from Xcode toolchain is too old.

- Made sure Boost is compiled using clang.

  Without this gcc was used, and some unsupported command line argument
  was passed to it.

- Modify OGG in a way which does in fact pull fixed sized types.
  They are defined in stdint.h.

  Without this fix FFmpeg will not detect presence of OGG because the
  test program fails to compile.

- Force disable zstd compression and make wepb optional for the TIFF
  library. Without this TIFF might pick up development libraries from
  Homebrew.

Differential Revision: https://developer.blender.org/D8221
This commit is contained in:
Sergey Sharybin 2020-07-06 15:28:19 +02:00
parent b28683b8b5
commit d212b3dc43
7 changed files with 38 additions and 3 deletions

View File

@ -30,7 +30,7 @@
# build_deps 2015 x64 / build_deps 2015 x86
#
# MAC OS X USAGE:
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm bison
# Run "make deps" from main Blender directory
#
# LINUX USAGE:

View File

@ -44,7 +44,7 @@ if(WIN32)
elseif(APPLE)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS toolset=darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off)
set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off)
set(BOOST_HARVEST_CMD echo .)
set(BOOST_PATCH_COMMAND echo .)
else()

View File

@ -30,6 +30,7 @@ if(UNIX)
nasm
yasm
tclsh
bison
)
foreach(_software ${_required_software})
@ -40,6 +41,12 @@ if(UNIX)
unset(_software_find CACHE)
endforeach()
if(APPLE)
if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
set(_software_missing "${_software_missing} bison")
endif()
endif()
if(_software_missing)
message(
"\n"
@ -50,7 +57,7 @@ if(UNIX)
" apt install autoconf automake libtool yasm nasm tcl\n"
"\n"
"On macOS (with homebrew):\n"
" brew install cmake autoconf automake libtool yasm nasm\n"
" brew install cmake autoconf automake libtool yasm nasm bison\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")

View File

@ -22,6 +22,12 @@ if(WIN32)
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
)
elseif(APPLE)
# Use bison installed via Homebrew.
# The one which comes which Xcode toolset is too old.
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
)
endif()
set(ISPC_EXTRA_ARGS
@ -36,6 +42,7 @@ set(ISPC_EXTRA_ARGS
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
)
ExternalProject_Add(external_ispc

View File

@ -21,6 +21,7 @@ ExternalProject_Add(external_ogg
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make install

View File

@ -16,6 +16,12 @@
#
# ***** END GPL LICENSE BLOCK *****
if(WITH_WEBP)
set(WITH_TIFF_WEBP ON)
else()
set(WITH_TIFF_WEBP OFF)
endif()
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
@ -23,6 +29,8 @@ set(TIFF_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-Dlzma=OFF
-Djbig=OFF
-Dzstd=OFF
-Dwebp=${WITH_TIFF_WEBP}
)
ExternalProject_Add(external_tiff

View File

@ -0,0 +1,12 @@
diff --git a/include/ogg/os_types.h b/include/ogg/os_types.h
index eb8a322..6f73b72 100644
--- a/include/ogg/os_types.h
+++ b/include/ogg/os_types.h
@@ -71,6 +71,7 @@
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
+# include <stdint.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;