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