SHARE
TWEET

blender_build.sh

a guest Oct 24th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. BUILD_DIR="/home/cross/vocore/blender_git_2/build_2"
  4. SRC_DIR="/home/cross/vocore/blender_git_2/src_1"
  5. COMPILER_DIR="/opt/cc/vocore2_soft4/mipsel-unknown-linux-gnu"
  6.  
  7. mkdir -p "${BUILD_DIR}"
  8. cd "${BUILD_DIR}"
  9.  
  10. SROOT="/home/cross/vocore/buildroot_git_2/output/host/mipsel-buildroot-linux-gnu/sysroot"
  11.  
  12. export ARCH="24kec"
  13.  
  14. export PATH=${PATH}:${COMPILER_DIR}/bin
  15.  
  16. export HOST="mipsel-unknown-linux-gnu"
  17.  
  18. export CROSS_COMPILE="${HOST}-"
  19. export CROSS=${CROSS_COMPILE}
  20.  
  21. ### standard compilation variables
  22. export CC="${CROSS_COMPILE}gcc --sysroot=${SROOT}"
  23. export CXXCPP="${CROSS_COMPILE}cpp --sysroot=${SROOT}"
  24. export CXX="${CROSS_COMPILE}g++ --sysroot=${SROOT}"
  25.  
  26. export CFLAGS=" -I${SROOT}/usr/include/ -march=${ARCH} -Ofast -mdsp  -Wno-error=implicit-function-declaration"
  27. export LDFLAGS=" -L${SROOT}/lib/ -L${SROOT}/usr/lib/ "
  28. export CPPFLAGS=" -I${SROOT}/usr/include/ -Wno-error=implicit-function-declaration -march=${ARCH} -Ofast -mdsp "
  29. export CXXFLAGS=" -I${SROOT}/usr/include/ -Wno-error=implicit-function-declaration -march=${ARCH} -Ofast -mdsp "
  30.  
  31. export PKG_CONFIG_DIR=
  32. export PKG_CONFIG_SYSROOT_DIR=${SROOT}
  33. export PKG_CONFIG_LIBDIR="${SROOT}/usr/local/lib:${SROOT}/usr/lib"
  34.  
  35. FL="-Ofast -mdsp -msoft-float -mtune=24kec -DNDEBUG"
  36. GCC_PATH="/home/cross/vocore/buildroot_git_2/output/host/bin"
  37.  
  38. ### run cmake
  39. ccmake -DCMAKE_SYSROOT=${SROOT} -DWITH_CYCLES=OFF -DCMAKE_CXX_FLAGS_RELEASE="${FL}" -DCMAKE_C_FLAGS_RELEASE="${FL}" \
  40. -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="-flto" \
  41. -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-flto" -DWITH_PYTHON_INSTALL_NUMPY=OFF -DCMAKE_CROSSCOMPILING=TRUE \
  42. -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-flto" \
  43. -DCMAKE_FIND_ROOT_PATH="${COMPILER_DIR}" \
  44. -DCMAKE_CXX_COMPILER_AR="${GCC_PATH}/mipsel-unknown-linux-gnu-gcc-ar" \
  45. -DCMAKE_CXX_COMPILER_RANLIB="${GCC_PATH}/mipsel-unknown-linux-gnu-gcc-ranlib" \
  46. -DCMAKE_C_COMPILER_AR="${GCC_PATH}/mipsel-unknown-linux-gnu-gcc-ar" \
  47. -DCMAKE_C_COMPILER_RANLIB="${GCC_PATH}/mipsel-unknown-linux-gnu-gcc-ranlib" \
  48. -DCMAKE_AR="${GCC_PATH}/mipsel-unknown-linux-gnu-ar" \
  49. -DCMAKE_LINKER="${GCC_PATH}/mipsel-unknown-linux-gnu-ld" \
  50. -DCMAKE_NM="${GCC_PATH}/mipsel-unknown-linux-gnu-nm" \
  51. -DCMAKE_OBJCOPY="${GCC_PATH}/mipsel-unknown-linux-gnu-objcopy" \
  52. -DCMAKE_OBJDUMP="${GCC_PATH}/mipsel-unknown-linux-gnu-objdump" \
  53. -DCMAKE_RANLIB="${GCC_PATH}/mipsel-unknown-linux-gnu-ranlib" \
  54. -DCMAKE_STRIP="${GCC_PATH}/mipsel-unknown-linux-gnu-strip" \
  55. -DWITH_PYTHON_INSTALL=OFF -DWITH_PYTHON_INSTALL_REQUESTS=OFF -DWITH_PYTHON_SECURITY=OFF -DWITH_PYTHON_SAFETY=OFF -DWITH_CYCLES_DEVICE_CUDA=OFF \
  56. -DWITH_CYCLES_DEVICE_OPENCL=OFF -DWITH_AUDASPACE=OFF \
  57. -DWITH_CUDA_DYNLOAD=OFF -DWITH_CPU_SSE=OFF -DWITH_INTERNATIONAL=OFF -DWITH_OPENIMAGEIO=OFF -DWITH_OPENAL=OFF \
  58. -DWITH_OPENMP=OFF \
  59. -DWITH_RAYOPTIMIZATION=OFF \
  60. -DPKG_CONFIG_EXECUTABLE=/home/cross/vocore/buildroot_git_2/output/host/bin/pkg-config \
  61. -DCUDA_PROPAGATE_HOST_FLAGS=OFF \
  62. -DCUDA_64_BIT_DEVICE_CODE=OFF \
  63. -DCUDA_ATTACH_VS_BUILD_RULE_TO_C=OFF \
  64. -DCUDA_HOST_COMPILATION_CPP=OFF \
  65. -DCMAKE_SKIP_INSTALL_RPATH=ON \
  66. -DCMAKE_VERBOSE_MAKEFILE=ON \
  67. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  68. -DWITH_MEM_JEMALLOC=OFF \
  69. -DWITH_TBB=OFF \
  70. -DCROSS=${CROSS} \
  71. ${SRC_DIR}/..
  72.  
  73.  
  74. ### patch binary calls of wrongly compiled targets: datatoc, datatoc_icon, makesrna, makesdna
  75. sed \
  76. -e "s/ \&\& \([^\&]*\/bin\/datatoc\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  77. -e "s/ \&\& \([^\&]*\/bin\/datatoc_icon\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  78. -i ${BUILD_DIR}/source/blender/draw/CMakeFiles/bf_draw.dir/build.make
  79.  
  80. sed \
  81. -e "s/ \&\& \([^\&]*\/bin\/datatoc\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  82. -e "s/ \&\& \([^\&]*\/bin\/datatoc_icon\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  83. -i ${BUILD_DIR}/source/blender/gpu/CMakeFiles/bf_gpu.dir/build.make
  84.  
  85. sed \
  86. -e "s/ \&\& \([^\&]*\/bin\/datatoc\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  87. -e "s/ \&\& \([^\&]*\/bin\/datatoc_icon\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  88. -i ${BUILD_DIR}/source/blender/compositor/CMakeFiles/bf_compositor.dir/build.make
  89.  
  90. sed \
  91. -e "s/ \&\& \([^\&]*\/bin\/datatoc\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  92. -e "s/ \&\& \([^\&]*\/bin\/datatoc_icon\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  93. -i ${BUILD_DIR}/source/blender/editors/datafiles/CMakeFiles/bf_editor_datafiles.dir/build.make
  94.  
  95. sed \
  96. -e "s/ \&\& \([^\&]*\/bin\/makesrna\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  97. -i ${BUILD_DIR}/source/blender/makesrna/intern/CMakeFiles/bf_rna.dir/build.make
  98.  
  99. sed \
  100. -e "s/ \&\& \([^\&]*\/bin\/makesdna\) / \&\& qemu-mipsel -cpu 24KEc  -L \/home\/cross\/vocore\/buildroot_git_2\/output\/staging \1 /g" \
  101. -i ${BUILD_DIR}/source/blender/makesdna/intern/CMakeFiles/bf_dna.dir/build.make
  102.  
  103. ### compile
  104. make -j 4 -k
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top