]> SALOME platform Git repositories - tools/install.git/blob - config_files/qwt-4.2.0.sh
Salome HOME
Add path to common libs into 'LD_LIBRARY_PATH'
[tools/install.git] / config_files / qwt-4.2.0.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : qwt-4.2.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 {
17 if [ -n "${QWTHOME}" ] ; then 
18     qwtinc=${QWTHOME}/include/qwt_global.h
19     if [ ! -f $qwtinc ] ; then
20         qwtinc=${QWTHOME}/include/qwt/qwt_global.h
21     fi
22     if [ -f $qwtinc ] ; then
23         ver=`grep -e "^#define[[:space:]]\+QWT_VERSION_STR" $qwtinc | sed -e 's/^#define[[:space:]]\+QWT_VERSION_STR[[:space:]]*"\(.*\)"/\1/'`
24         if [ "$ver" == "4.2.0" ]; then
25             return 0
26         fi
27     fi
28 fi
29 return 1
30 }
31
32 print_env_bin()
33 {
34 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
35 #$DELIM ${PRODUCT_TYPE} $DELIM
36 export QWTHOME=\${INSTALL_ROOT}/${PRODUCT}
37 export LD_LIBRARY_PATH=\${QWTHOME}/lib:\${LD_LIBRARY_PATH} 
38 ##
39 EOF
40 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
41 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
42 }
43
44 print_env_src()
45 {
46 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
47 #$DELIM ${PRODUCT_TYPE}_src $DELIM
48 # nothing to do
49 ##
50 EOF
51 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
52 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
53 }
54
55 try_preinstalled(){
56 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
57 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
58 return $?
59 }
60
61 install_source()
62 {
63 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
64 source ${INSTALL_WORK}/$SHRC
65
66 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
67
68 # to generate environment scripts
69 try_preinstalled
70 }
71
72 install_source_and_build()
73 {
74 # install sources
75 install_source
76
77 # build sources
78 cd ${PRODUCT_DIR}_SRC
79 makedir ${PRODUCT_DIR}
80
81 qmake qwt.pro -o Makefile
82
83 GCC=`which gcc`
84 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
85 used gcc=$GCC
86 EOF
87
88 check_job ${PRODUCT_DIR}/MAKE.LOG make 
89 cp -rf include lib ${PRODUCT_DIR}
90
91 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
92 cd ${PRODUCT_DIR};
93
94 # remove sources and temporary files after building
95 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
96     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
97 fi
98
99 # to generate environment scripts
100 try_preinstalled
101 }
102
103 install_binary()
104 {
105 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
106 source ${INSTALL_WORK}/$SHRC
107
108 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
109
110 # to generate environment script for sources
111 try_preinstalled
112 }
113
114 export PROCEDURE=$1;
115 export INSTALL_WORK=$2;
116 export SOURCE_DIR=$3;
117 export INSTALL_ROOT=$4;
118 export PRODUCT_SEQUENCE=$5;
119 export PRODUCT_TYPE=$6;
120 export INSTALL_PRODUCTS=$7;
121 shift
122 REMOVE_SRC_TMP=$8;
123 export PRODUCT="qwt-4.2.0"
124 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
125 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
126 source ./common.sh
127 $PROCEDURE