From d70e6b275831c2022c0d5091827dd52c36355da0 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 23 May 2014 16:42:12 +0400 Subject: [PATCH] Switch back to freeimage 3.15.4 on CentOS 5.5 due to gcc bug --- config_CentOS_5.5_64bit.xml | 4 +- config_files/freeimage_3.15.4.sh | 182 +++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+), 2 deletions(-) create mode 100755 config_files/freeimage_3.15.4.sh diff --git a/config_CentOS_5.5_64bit.xml b/config_CentOS_5.5_64bit.xml index 5a3dfa5..97707dd 100755 --- a/config_CentOS_5.5_64bit.xml +++ b/config_CentOS_5.5_64bit.xml @@ -467,10 +467,10 @@ type="prerequisite" description="Library for supporting different graphical formats PNG, BMP, JPEG, TIFF and others"> + script="freeimage_3.15.4.sh"/> ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <%g' ${PRODUCT_SRC_DIR}/Source/OpenEXR/IlmImf/ImfAutoArray.h +fi + +if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then + du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi + +# to generate environment scripts +try_preinstalled +} + +install_source_and_build() +{ +# install sources +install_source + +# build sources +test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} + +cd ${PRODUCT_SRC_DIR} + +## building FreeImage library + +# workaround for CentOS 5.5: FreeImage 3.16.0 is not compiled with gcc 4.2 and older :( +local workaround_gcc42_pb=1 +gcc_found="" +if [ "${workaround_gcc42_pb}" = "1" ] ; then + gcc_found="`use_latest_gcc 040200`" +fi + +# compile +check_job ${PRODUCT_DIR}/MAKE.LOG make ${gcc_found} -f Makefile.gnu + +# install +check_job ${PRODUCT_DIR}/INSTALL.LOG make ${gcc_found} -f Makefile.gnu DESTDIR=${PRODUCT_DIR} install + +# clean temporary files +###make -f Makefile.gnu clean + +## building FreeImagePlus library + +# compile +check_job ${PRODUCT_DIR}/MAKEPLUS.LOG make ${gcc_found} -f Makefile.fip + +# install +check_job ${PRODUCT_DIR}/INSTALLPLUS.LOG make ${gcc_found} -f Makefile.fip DESTDIR=${PRODUCT_DIR} install + +# clean temporary files +###make -f Makefile.fip clean + +cd ${PRODUCT_DIR} + +if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then + du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi + +# remove sources and temporary files after building +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then + test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} +fi + +# to generate environment scripts +try_preinstalled +} + +install_binary() +{ +make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} +source ${INSTALL_WORK}/${SHRC} + +# create a product directory +test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} + +check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR} + +# to generate environment script for sources +try_preinstalled +} + +export PROCEDURE=$1; +export INSTALL_WORK=$2; +export SOURCE_DIR=$3; +export INST_ROOT=$4; +export PRODUCT_SEQUENCE=$5; +export PRODUCT_TYPE=$6; +export INSTALL_PRODUCTS=$7; +shift +REMOVE_SRC_TMP=$8; +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="freeimage-${VERSION_FREEIMAGE}" +export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} +export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} +export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC +source ./common.sh +${PROCEDURE} -- 2.39.2