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" ]; then
19 ver=`grep "QT_VERSION_STR" ${QTDIR}/include/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
20 if [ "$ver" == "3.3.8" ] ; then
28 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
29 #$DELIM ${PRODUCT_TYPE} $DELIM
30 export QTDIR=\${INSTALL_ROOT}/${PRODUCT}
31 export PATH=\${QTDIR}/bin:\$PATH
32 export LD_LIBRARY_PATH=\${QTDIR}/lib:\${LD_LIBRARY_PATH}
35 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
36 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
41 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
42 #$DELIM ${PRODUCT_TYPE}_src $DELIM
46 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
47 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
51 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
52 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
58 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
59 source ${INSTALL_WORK}/$SHRC
61 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
63 # to generate environment scripts
67 install_source_and_build()
73 makedir ${PRODUCT_DIR}
77 mv -f configure configure-orig
78 sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
81 export QTDIR=${PRODUCT_DIR}_SRC
82 export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
85 if test `uname -m` = "x86_64" ; then
86 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++-64"
88 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++"
90 # use system graphics libraries
91 QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -lpng -lmng -ljpeg"
93 # add -dlopen-opengl flag (ONLY if the corresponding patch was applied)
94 if [ "$patched_for_gl" == "yes" ] ; then
95 QT_FLAGS=$QT_FLAGS" -dlopen-opengl"
99 if [ -e /etc/mandriva-release ] ; then
100 version=`cat /etc/mandriva-release | awk '{print $1$4}'`
101 if [ "$version" == "Mandriva2006.0" ] ; then
102 QT_FLAGS=$QT_FLAGS" -plugin-style-cde -plugin-style-compact -plugin-style-motif -plugin-style-motifplus -plugin-style-platinum -plugin-style-sgi"
107 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR}
109 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
110 mv -f _Makefile Makefile
113 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
116 # small trick: INSTALL_ROOT is used inside qt-3.3.3 installation
117 # so it should be set to empty string
118 export INSTALL_ROOT_BACKUP=$INSTALL_ROOT
119 export INSTALL_ROOT=""
120 check_job ${PRODUCT_DIR}/MAKE.LOG make
121 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
123 if test `uname -m` = "x86_64" ; then
124 cd ${PRODUCT_DIR}; ln -sf lib lib64
127 export INSTALL_ROOT=$INSTALL_ROOT_BACKUP
129 for b in `find bin -mindepth 1 -maxdepth 1 -name "*"`; do
131 if [ ! -e ${PRODUCT_DIR}/bin/$b ] || [ -h ${PRODUCT_DIR}/bin/$b ]; then
132 if [ -h ${PRODUCT_DIR}/bin/$b ]; then
133 rm -f ${PRODUCT_DIR}/bin/$b
135 cp -f ${PRODUCT_DIR}_SRC/bin/$b ${PRODUCT_DIR}/bin/$b
139 # modify libGL.so flags
140 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
141 gllibdir="`where_gl_libs`"
142 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
144 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
145 ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
146 mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
149 #rm -rf ${PRODUCT_DIR}/doc
151 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
154 # remove sources and temporary files after building
155 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
156 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
159 # to generate environment scripts
165 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
166 source ${INSTALL_WORK}/$SHRC
168 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
171 cd ${PRODUCT_DIR}/lib
172 sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
173 mv -f libqt-mt.la.new libqt-mt.la
175 # modify libGL.so flags
176 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
177 gllibdir="`where_gl_libs`"
178 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
180 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
181 libqt-mt.la > libqt-mt.la.new
182 mv -f libqt-mt.la.new libqt-mt.la
185 # modify qt package config
186 cd ${PRODUCT_DIR}/lib/pkgconfig
187 sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
188 mv -f qt-mt.pc.new qt-mt.pc
190 # to generate environment scripts
195 export INSTALL_WORK=$2;
196 export SOURCE_DIR=$3;
197 export INSTALL_ROOT=$4;
198 export PRODUCT_SEQUENCE=$5;
199 export PRODUCT_TYPE=$6;
200 export INSTALL_PRODUCTS=$7;
203 export PRODUCT="qt-3.3.8"
204 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
205 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}