]> SALOME platform Git repositories - tools/install.git/blob - config_files/BOOST-1.32.0.sh
Salome HOME
Update for Salome 3.2.6
[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()
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}"
35 }
36
37 # looks for the native product and collects it's environment (used by make_env())
38 try_native(){
39 boostdir="`find_in_path version.hpp /usr/include/boost:/usr/share/include/boost`"
40 if [ -n "${boostdir}" ] ; then
41     boostdir=`cd ${boostdir}/../..; pwd`
42     ls ${boostdir}/lib/libboost_thread* &> /dev/null
43     if [ "$?" -ne "0" ] ; then 
44         return 1
45     fi
46     ver=`egrep 'BOOST_VERSION [0-9]+' ${boostdir}/include/boost/version.hpp | sed 's/.*BOOST_VERSION \([0-9]\+\)/\1/g'`
47     if [ $ver -ge 103200 ] ;  then 
48         cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
49 #$DELIM ${PRODUCT_TYPE} $DELIM 
50 export BOOSTDIR=${boostdir}
51 export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
52 ##
53 EOF
54         make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
55         if [ $ver -eq 103200 ] ;  then 
56             return 0
57         else
58             return 2
59         fi
60     fi
61 fi
62 return 1
63 }
64
65 try_preinstalled(){
66 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
67 return $?
68 }
69
70 install_source()
71 {
72 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
73 source ${INSTALL_WORK}/$SHRC
74
75 makedir ${PRODUCT_DIR}
76
77 # unpack
78 check_jb tar xzf ${SOURCE_DIR}/boost-1.32.0.tar.gz -C ${INSTALL_WORK}
79
80 # build
81 GCC=`which gcc`
82 cat >> ${PRODUCT_DIR}/BUILD.LOG <<EOF
83 used gcc=$GCC
84 EOF
85 cd ${PRODUCT_WORK}/tools/build/jam_src
86 check_job ${PRODUCT_DIR}/BUILD.LOG ./build.sh
87
88 # apply patch to avoid conflicts with Qt signals
89 # VSR 07/03/06 : this is no more needed
90 #cd ${PRODUCT_WORK}/boost/signals/detail
91 #sed -e "s%#  define BOOST_SIGNALS_NAMESPACE signals%#  define BOOST_SIGNALS_NAMESPACE bsignals%g" \
92 #    signals_common.hpp > signals_common.hpp.orig
93 #mv -f signals_common.hpp.orig signals_common.hpp
94
95 # install
96 cd ${PRODUCT_WORK}
97 python_root=`find_in_path python $PATH`;
98 python_root=`cd ${python_root}/..; pwd`
99 python_version=`python -c "import sys; print sys.version[:3]"`
100 if test `uname -m` = "x86_64" ; then
101 export binfolder=bin.linux
102 else
103 export binfolder=bin.linuxx86
104 fi
105 echo "`pwd` -> ./tools/build/jam_src/${binfolder}/bjam >> ${PRODUCT_DIR}/INSTALL.LOG"
106 ./tools/build/jam_src/${binfolder}/bjam "-sBOOST_ALL_DYN_LINK=1"         \
107     "-sBUILD=release <runtime-link>dynamic <threading>multi"             \
108     --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_WORK}                   \
109     "-sPYTHON_VERSION=$python_version" --with-python-root=${python_root} \
110     install >> ${PRODUCT_DIR}/INSTALL.LOG 2> $INSTALL_WORK/errlog
111
112 if [ "$?" -ne "0" ] ; then
113     cat ${PRODUCT_DIR}/INSTALL.LOG
114     cat $INSTALL_WORK/errlog >&2
115     cat $INSTALL_WORK/errlog >> ${PRODUCT_DIR}/INSTALL.LOG
116 fi
117
118 # move includes
119 cd ${PRODUCT_DIR}/include
120 mv -f boost-1_32/boost boost
121 rm -rf boost-1_32
122
123 # create additional links for libraries
124 cd ${PRODUCT_DIR}/lib
125 for aLib in date_time filesystem prg_exec_monitor python regex signals test_exec_monitor thread unit_test_framework ; do
126     if [ -f libboost_${aLib}-gcc-mt-1_32.so ] ; then
127         ln -s libboost_${aLib}-gcc-mt-1_32.so libboost_${aLib}-mt.so
128     fi
129 done
130   if test `uname -m` = "x86_64" ; then
131       cd ${PRODUCT_DIR}; ln -sf lib lib64
132   fi
133 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
134 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
135
136 print_env
137 }
138
139 install_binary()
140 {
141 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
142 source ${INSTALL_WORK}/$SHRC
143
144 check_jb tar xfz ${SOURCE_DIR}/boost-1.32.0.tar.gz -C ${INSTALL_ROOT}
145
146 print_env
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 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="boost" ; fi
155 export PRODUCT="boost-1.32.0"
156 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
157 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
158 source ./common.sh
159 $PROCEDURE