3 ####################################################################################
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
16 if [ -z "$QTDIR" ] || [ ! -f ${QTDIR}/include/qglobal.h ]; then
20 ver=`grep "QT_VERSION_STR" ${QTDIR}/include/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
21 if [ "$ver" == "3.3.3" ] ; then
29 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
30 #$DELIM ${PRODUCT_TYPE} $DELIM
31 export QTDIR=\${INSTALL_ROOT}/${PRODUCT}
32 export PATH=\${QTDIR}/bin:\$PATH
33 export LD_LIBRARY_PATH=\${QTDIR}/lib:\${LD_LIBRARY_PATH}
36 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
37 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
42 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
43 #$DELIM ${PRODUCT_TYPE}_src $DELIM
47 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
48 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
52 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
53 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
59 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
60 source ${INSTALL_WORK}/$SHRC
62 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
64 # to generate environment scripts
68 install_source_and_build()
74 makedir ${PRODUCT_DIR}
76 # apply patch : fix pb of libGL loading
77 if [ -f patches/qt-3.3.3-load-gl.patch ] ; then
78 cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_DIR}_SRC
79 ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < qt-3.3.3-load-gl.patch )
85 mv -f configure configure-orig
86 sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
89 export QTDIR=${PRODUCT_DIR}_SRC
90 export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
93 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++"
94 # use system graphics libraries
95 QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -lpng -lmng -ljpeg"
96 # use all plugin styles except -plugin-style-windows
97 QT_FLAGS=$QT_FLAGS" -plugin-style-cde -plugin-style-compact -plugin-style-motif -plugin-style-motifplus -plugin-style-platinum -plugin-style-sgi"
99 # add -dlopen-opengl flag (ONLY if the corresponding patch was applied)
100 if [ "$patched_for_gl" == "yes" ] ; then
101 QT_FLAGS=$QT_FLAGS" -dlopen-opengl"
105 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR}
107 sed -e "s%^all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples%all: symlinks src-qmake src-moc sub-src sub-tools%g" Makefile > _Makefile
108 mv -f _Makefile Makefile
111 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
114 # small trick: INSTALL_ROOT is used inside qt-3.3.3 installation
115 # so it should be set to empty string
116 export INSTALL_ROOT_BACKUP=$INSTALL_ROOT
117 export INSTALL_ROOT=""
118 check_job ${PRODUCT_DIR}/MAKE.LOG make
119 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
120 export INSTALL_ROOT=$INSTALL_ROOT_BACKUP
122 for b in `find bin -mindepth 1 -maxdepth 1 -name "*"`; do
124 if [ ! -e ${PRODUCT_DIR}/bin/$b ] || [ -h ${PRODUCT_DIR}/bin/$b ]; then
125 if [ -h ${PRODUCT_DIR}/bin/$b ]; then
126 rm -f ${PRODUCT_DIR}/bin/$b
128 cp -f ${PRODUCT_DIR}_SRC/bin/$b ${PRODUCT_DIR}/bin/$b
132 # modify libGL.so flags
133 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
134 gllibdir="`where_gl_libs`"
135 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
137 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
138 ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
139 mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
142 #rm -rf ${PRODUCT_DIR}/doc
144 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
147 # remove sources and temporary files after building
148 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
149 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
152 # to generate environment scripts
158 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
159 source ${INSTALL_WORK}/$SHRC
161 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
163 cd ${PRODUCT_DIR}/lib
166 sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
167 mv -f libqt-mt.la.new libqt-mt.la
169 # modify libGL.so flags
170 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
171 gllibdir="`where_gl_libs`"
172 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
174 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
175 libqt-mt.la > libqt-mt.la.new
176 mv -f libqt-mt.la.new libqt-mt.la
179 # modify qt package config
180 cd ${PRODUCT_DIR}/lib/pkgconfig
181 sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
182 mv -f qt-mt.pc.new qt-mt.pc
184 # to generate environment scripts
189 export INSTALL_WORK=$2;
190 export SOURCE_DIR=$3;
191 export INSTALL_ROOT=$4;
192 export PRODUCT_SEQUENCE=$5;
193 export PRODUCT_TYPE=$6;
194 export INSTALL_PRODUCTS=$7;
197 export PRODUCT="qt-3.3.3"
198 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
199 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}