]> SALOME platform Git repositories - tools/install.git/blob - config_files/sip-4.1.sh
Salome HOME
Fix a problem with *.la files caused by modifications in KERNEL module compilation...
[tools/install.git] / config_files / sip-4.1.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 if [ -n "${SIPDIR}" ]; then
6     sip_ver=`${SIPDIR}/sip -V | awk '{print $1}'`
7     if [ "$sip_ver" == "4.1" ]; then
8         return 0
9     fi
10 fi
11 return 1
12 }
13
14 print_env()
15 {
16 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
17 #$DELIM ${PRODUCT_TYPE} $DELIM
18 export SIPDIR=\${INSTALL_ROOT}/${PRODUCT}
19 export PATH=\${SIPDIR}:\${PATH}
20 export PYTHONPATH=\${SIPDIR}:\${PYTHONPATH}
21 export LD_LIBRARY_PATH=\${SIPDIR}:\${LD_LIBRARY_PATH}
22 ##
23 EOF
24 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
25 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
26 }
27
28 # looks for the native product and collects it's environment (used by make_env())
29 try_native(){
30 sipdir="`find_in_path sip ${PATH}`"
31 if [ -z "${sipdir}" ] ; then
32     sipdir="`find_in_path sip /usr/bin`"
33 fi
34 if [ -n "${sipdir}" ] ; then
35     python_version="`python -c 'import sys; print sys.version[:3]'`"
36     sippython="`find_in_path sip.so ${PYTHONPATH}`"
37     if [ -z "${sippython}" ] ; then
38         sippython="`find_in_path sip.so /usr/lib/python${python_version}/site-packages`"
39     fi
40     if [ -n "${sippython}" ]; then
41         tmp="${sipdir} ${sipdir} \${PATH} ${PATH}";
42         path=`sort_path ${tmp}`
43         tmp="${sippython} ${sippython} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
44         ld_library_path=`sort_path ${tmp}`
45         tmp="${sippython} ${sippython} \${PYTHONPATH} ${PYTHONPATH}";
46         pythonpath=`sort_path ${tmp}`
47         cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
48 #$DELIM ${PRODUCT_TYPE} $DELIM
49 export PATH=${path}
50 export PYTHONPATH=${pythonpath}
51 export LD_LIBRARY_PATH=${ld_library_path}
52 ##
53 EOF
54         make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
55         return 0
56     fi
57 fi
58 return 1
59 }
60
61 try_preinstalled(){
62 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
63 return $?
64 }
65
66 install_source()
67 {
68 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
69 source ${INSTALL_WORK}/$SHRC
70
71 makedir ${PRODUCT_DIR}
72
73 check_jb tar xfz ${SOURCE_DIR}/sip-4.1.tar.gz -C ${INSTALL_WORK}
74 cd ${PRODUCT_WORK}
75
76 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
77     python configure.py -b ${PRODUCT_DIR} -d ${PRODUCT_DIR} -e ${PRODUCT_DIR} -v ${PRODUCT_DIR} -l qt-mt 
78 GCC=`which gcc`
79 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
80 used gcc=$GCC
81 EOF
82 check_job ${PRODUCT_DIR}/MAKE.LOG make
83 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
84
85 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
86 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
87 print_env
88 }
89
90 install_binary()
91 {
92 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
93 source ${INSTALL_WORK}/$SHRC
94
95 check_jb tar xfz ${SOURCE_DIR}/sip-4.1.tar.gz -C ${INSTALL_ROOT}
96
97 print_env
98 }
99
100 export PROCEDURE=$1;
101 export INSTALL_WORK=$2;
102 export SOURCE_DIR=$3;
103 export INSTALL_ROOT=$4;
104 export PRODUCT_SEQUENCE=$5;
105 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="sip" ; fi
106 export PRODUCT="sip-4.1"
107 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
108 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
109 source ./common.sh
110 $PROCEDURE