]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Provide binaries compilation mode for BOOST 1.31.0
authorvsr <vsr@opencascade.com>
Thu, 9 Feb 2006 16:55:33 +0000 (16:55 +0000)
committervsr <vsr@opencascade.com>
Thu, 9 Feb 2006 16:55:33 +0000 (16:55 +0000)
config_files/BOOST-1.31.0.sh

index a694d27826e99256074e857e3c77e554f9995fc8..322359b0493876b5e2ac34b4d5fbec61ca2b3bfa 100755 (executable)
@@ -15,6 +15,7 @@ print_env()
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
 #$DELIM ${PRODUCT_TYPE} $DELIM 
 export BOOSTDIR=\${INSTALL_ROOT}/${PRODUCT}
+export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -29,11 +30,16 @@ if [ -z "${boostdir}" ] ; then
 fi
 if [ -n "${boostdir}" ] ; then
     boostdir=`cd ${boostdir}/..; pwd`
+    ls ${boostdir}/lib/libboost_thread* &> /dev/null
+    if [ "$?" -ne "0" ] ; then 
+       return 1
+    fi
     ver=`egrep 'BOOST_VERSION [0-9]+' ${boostdir}/boost/version.hpp | sed 's/.*BOOST_VERSION \([0-9]\+\)/\1/g'`
     if [ $ver -ge 103100 ] ;  then 
        cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
 #$DELIM ${PRODUCT_TYPE} $DELIM 
 export BOOSTDIR=${boostdir}
+export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
 ##
 EOF
        make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
@@ -57,15 +63,71 @@ install_source()
 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
 source ${INSTALL_WORK}/$SHRC
 
-check_jb tar xfz ${SOURCE_DIR}/boost-1.31.0.tar.gz -C ${INSTALL_ROOT}
+makedir ${PRODUCT_DIR}
+
+# unpack
+check_jb tar xzf ${SOURCE_DIR}/boost-1.31.0.tar.gz -C ${INSTALL_WORK}
+
+# build
+GCC=`which gcc`
+cat >> ${PRODUCT_DIR}/BUILD.LOG <<EOF
+used gcc=$GCC
+EOF
+cd ${PRODUCT_WORK}/tools/build/jam_src
+check_job ${PRODUCT_DIR}/BUILD.LOG ./build.sh
+
+# apply patch to avoid conflicts with Qt signals
+cd ${PRODUCT_WORK}/boost/signals/detail
+sed -e "s%#  define BOOST_SIGNALS_NAMESPACE signals%#  define BOOST_SIGNALS_NAMESPACE bsignals%g" \
+    signals_common.hpp > signals_common.hpp.orig
+mv -f signals_common.hpp.orig signals_common.hpp
+
+# install
+cd ${PRODUCT_WORK}
+python_root=`find_in_path python $PATH`;
+python_root=`cd ${python_root}/..; pwd`
+python_version=`python -c "import sys; print sys.version[:3]"`
+
+echo "`pwd` -> ./tools/build/jam_src/bin.linuxx86/bjam >> ${PRODUCT_DIR}/INSTALL.LOG"
+./tools/build/jam_src/bin.linuxx86/bjam "-sBOOST_ALL_DYN_LINK=1"         \
+    "-sBUILD=release <runtime-link>dynamic <threading>multi"             \
+    --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_WORK}                   \
+    "-sPYTHON_VERSION=$python_version" --with-python-root=${python_root} \
+    install >> ${PRODUCT_DIR}/INSTALL.LOG 2> $INSTALL_WORK/errlog
+
+if [ "$?" -ne "0" ] ; then
+    cat ${PRODUCT_DIR}/INSTALL.LOG
+    cat $INSTALL_WORK/errlog >&2
+    cat $INSTALL_WORK/errlog >> ${PRODUCT_DIR}/INSTALL.LOG
+fi
+
+# move includes
+cd ${PRODUCT_DIR}/include
+mv -f boost-1_31/boost boost
+rm -rf boost-1_31
+
+# create additional links for libraries
+cd ${PRODUCT_DIR}/lib
+for aLib in date_time filesystem prg_exec_monitor python regex signals test_exec_monitor thread unit_test_framework ; do
+    if [ -f libboost_${aLib}-gcc-mt-1_31.so ] ; then
+       ln -s libboost_${aLib}-gcc-mt-1_31.so libboost_${aLib}-mt.so
+    fi
+done
+
+du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
 
 print_env
 }
 
 install_binary()
 {
-echo "It impossible to install BOOST 1.31.0 from binaries, try to install it from sources."
-return 1
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+check_jb tar xfz ${SOURCE_DIR}/boost-1.31.0.tar.gz -C ${INSTALL_ROOT}
+
+print_env
 }
 
 export PROCEDURE=$1;