]> SALOME platform Git repositories - tools/install.git/blob - config_files/BOOST-1.32.0.sh
Salome HOME
Add path to common libs into 'LD_LIBRARY_PATH'
[tools/install.git] / config_files / BOOST-1.32.0.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : BOOST-1.32.0.sh
5 #  Created   : Thu Dec 18 12:01:00 2002
6 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
7 #  Project   : SALOME
8 #  Module    : Installation Wizard
9 #  Copyright : 2002-2007 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 check_version(){
16 if [ -n "${BOOSTDIR}" ] && [ -f ${BOOSTDIR}/include/boost/version.hpp ] ; then
17     ver=`egrep 'BOOST_VERSION [0-9]+' ${BOOSTDIR}/include/boost/version.hpp | sed 's/.*BOOST_VERSION \([0-9]\+\)/\1/g'`
18     if [ "$ver" = "103200" ]; then
19         return 0
20     fi
21 fi
22 return 1;
23 }
24
25 print_env_bin()
26 {
27 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
28 #$DELIM ${PRODUCT_TYPE} $DELIM 
29 export BOOSTDIR=\${INSTALL_ROOT}/${PRODUCT}
30 export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
31 ##
32 EOF
33 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
34 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
35 }
36
37 print_env_src()
38 {
39 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF 
40 #$DELIM ${PRODUCT_TYPE}_src $DELIM
41 # nothing to do
42 ##
43 EOF
44 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
45 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
46 }
47
48 try_preinstalled(){
49 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
50 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
51 return $?
52 }
53
54 install_source()
55 {
56 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
57 source ${INSTALL_WORK}/$SHRC
58
59 # unpack
60 check_jb tar xzf ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
61
62 # to generate environment scripts
63 try_preinstalled
64 }
65
66 install_source_and_build()
67 {
68 # install sources
69 install_source
70
71 # build sources
72 makedir ${PRODUCT_DIR}
73
74 GCC=`which gcc`
75 cat >> ${PRODUCT_DIR}/BUILD.LOG <<EOF
76 used gcc=$GCC
77 EOF
78 cd ${PRODUCT_DIR}_SRC/tools/build/jam_src
79 check_job ${PRODUCT_DIR}/BUILD.LOG ./build.sh
80
81 # apply patch to avoid conflicts with Qt signals
82 # VSR 07/03/06 : this is no more needed
83 #cd ${PRODUCT_DIR}_SRC/boost/signals/detail
84 #sed -e "s%#  define BOOST_SIGNALS_NAMESPACE signals%#  define BOOST_SIGNALS_NAMESPACE bsignals%g" \
85 #    signals_common.hpp > signals_common.hpp.orig
86 #mv -f signals_common.hpp.orig signals_common.hpp
87
88 # install
89 cd ${PRODUCT_DIR}_SRC
90 python_root=`find_in_path python $PATH`;
91 python_root=`cd ${python_root}/..; pwd`
92 python_version=`python -c "import sys; print sys.version[:3]"`
93 if test `uname -m` = "x86_64" ; then
94 export binfolder=bin.linux
95 else
96 export binfolder=bin.linuxx86
97 fi
98 echo "`pwd` -> ./tools/build/jam_src/${binfolder}/bjam >> ${PRODUCT_DIR}/INSTALL.LOG"
99 ./tools/build/jam_src/${binfolder}/bjam "-sBOOST_ALL_DYN_LINK=1"         \
100     "-sBUILD=release <runtime-link>dynamic <threading>multi"             \
101     --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_DIR}_SRC                \
102     "-sPYTHON_VERSION=$python_version" --with-python-root=${python_root} \
103     install >> ${PRODUCT_DIR}/INSTALL.LOG 2> $INSTALL_WORK/errlog
104
105 if [ "$?" -ne "0" ] ; then
106     cat ${PRODUCT_DIR}/INSTALL.LOG
107     cat $INSTALL_WORK/errlog >&2
108     cat $INSTALL_WORK/errlog >> ${PRODUCT_DIR}/INSTALL.LOG
109 fi
110
111 # move includes
112 cd ${PRODUCT_DIR}/include
113 mv -f boost-1_32/boost boost
114 rm -rf boost-1_32
115
116 # create additional links for libraries
117 cd ${PRODUCT_DIR}/lib
118 for aLib in date_time filesystem prg_exec_monitor python regex signals test_exec_monitor thread unit_test_framework ; do
119     if [ -f libboost_${aLib}-gcc-mt-1_32.so ] ; then
120         ln -s libboost_${aLib}-gcc-mt-1_32.so libboost_${aLib}-mt.so
121     fi
122 done
123   if test `uname -m` = "x86_64" ; then
124       cd ${PRODUCT_DIR}; ln -sf lib lib64
125   fi
126 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
127 cd ${PRODUCT_DIR};
128
129 # remove sources and temporary files after building
130 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
131     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
132 fi
133
134 # to generate environment scripts
135 try_preinstalled
136 }
137
138 install_binary()
139 {
140 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
141 source ${INSTALL_WORK}/$SHRC
142
143 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
144
145 # to generate environment scripts
146 try_preinstalled
147 }
148
149 export PROCEDURE=$1;
150 export INSTALL_WORK=$2;
151 export SOURCE_DIR=$3;
152 export INSTALL_ROOT=$4;
153 export PRODUCT_SEQUENCE=$5;
154 export PRODUCT_TYPE=$6;
155 export INSTALL_PRODUCTS=$7;
156 shift
157 REMOVE_SRC_TMP=$8;
158 export PRODUCT="boost-1.32.0"
159 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
160 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
161 source ./common.sh
162 $PROCEDURE