You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

238 lines
5.2 KiB

#!/bin/bash
# 接收参数
TARGET="$2"
WORK="$3"
STAGE=$9
# 记录已经完成的编译阶段,如果上一次编译发生错误,则提前终此脚本运行
function complete_stage() {
local next=$1
cd $SHELLROOT
if [ $2 -eq 0 ]
then
echo -n $next > $TARGET/stage
else
exit 1
fi
sleep 2
}
#######################################################################################################################################################################################
# 开始编译
cd $SHELLROOT # 建入到 本编译脚本项目 的根目录
mkdir -p tempDIR # 新建 本编译脚本项目 在运行所需要的临时工作目录
echo -ne "\033]0;Preparing\007" # 检查当前编译工作已经进入哪个阶段
if [ ! $STAGE ] ; then
S=`cat $TARGET/stage 2>/dev/null`
if [[ ! $S ]] ; then
STAGE=0
else
STAGE=$S
fi
fi
echo " * 使用 GCC 编译器"
# # STAGE 0.1 -- zlib
# NEXT=0.2
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-zlib.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 0.2 -- bzip2
# NEXT=0.3
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-bzip2.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 0.3 -- lzma
# NEXT=0.4
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-lzma.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 1.1 -- Boost
# NEXT=1.2
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-boost.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 1.2 -- Jpeg
# NEXT=1.3
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-Jpeg.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 1.3 -- Tiff
# NEXT=1.4
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-Tiff.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 1.4 -- PNG
# NEXT=1.5
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-PNG.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 1.5 -- FreeType
# NEXT=1.6
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-FreeType.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 1.6 -- OpenEXR
# NEXT=2.1
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-OpenEXR.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# STAGE 2.1 -- OpenImageIO
NEXT=2.2
if [[ $STAGE && $STAGE < $NEXT ]] ; then
echo $BOUNDARYSTART
${SHELLROOT}/compileing/compile-OpenImageIO.sh "$TARGET" "$CONFIGOPTS"
complete_stage $NEXT $?
echo $BOUNDARYEND
fi
# # STAGE 3 -- Qt
# NEXT=4.1
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-qt.sh "$TARGET" "$CONFIGOPTS"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 4.1 -- Embree
# NEXT=4.2
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-Embree.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 4.2 -- Oidn
# NEXT=4.3
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-Oidn.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 4.3 -- C-blosc
# NEXT=4.4
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-CBlosc.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 4.4 -- TBB
# NEXT=4.5
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-TBB.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 4.5 -- NVRTC
# NEXT=5
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-NVRTC.sh "$TARGET"
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # STAGE 5 -- LuxCore
# NEXT=6
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-LuxCore.sh "$TARGET"
# complete_stage $NEXT $?
# echo -n "export PATH=${SHELLROOT}/LuxCore/bin:\$PATH" | sudo tee -a /etc/profile
# echo -e "\n\n"
# echo $BOUNDARYEND
# fi
# # STAGE 6 -- LuxMark
# NEXT=7
# if [[ $STAGE && $STAGE < $NEXT ]] ; then
# echo $BOUNDARYSTART
# ${SHELLROOT}/compileing/compile-LuxMark.sh
# complete_stage $NEXT $?
# echo $BOUNDARYEND
# fi
# # 编译已经完成,执行 install脚本,完成最后的安装部署
# echo $BOUNDARYSTART
# echo -e "\n 正在完成最后的安装部署\n"
# if ! ${SHELLROOT}/utils/install "$TARGET" "LuxCore" "${SHELLROOT}/distfiles" ; then
# echo " * 安装失败"
# else
# echo -e "\n * 安装成功 $TARGET/$LUX_TAG"
# echo -e " * 恭喜你,LuxCore已经编译安装成功\n"
# fi
# echo $BOUNDARYEND
sleep 2
exit 0