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.4" ] ; 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}"
39 # looks for the native product and collects it's environment (used by make_env())
43 if test `uname -m` = "x86_64" ; then
44 export QT_LD_PREFIX='64'
49 if [ -d /usr/share/qt3/lib${QT_LD_PREFIX} ] ; then
50 qtdir="`find_in_path libqt-mt.so.3.3 /usr/share/qt3/lib\${QT_LD_PREFIX}`"
52 if [ -z "${qtdir}" ] && [ -d /usr/lib/qt3/lib${QT_LD_PREFIX} ] ; then
53 qtdir="`find_in_path libqt-mt.so.3.3 /usr/lib/qt3/lib${QT_LD_PREFIX}`"
55 if [ -z "${qtdir}" ] ; then
56 qtdir="`find_in_path libqt-mt.so.3.3 /usr/lib${QT_LD_PREFIX}`"
58 if [ -z "${qtdir}" ] ; then
59 qtdir="`find_in_path libqt-mt.so.3.3 ${LD_LIBRARY_PATH}`"
61 if [ -n "${qtdir}" ] ; then
62 qtdir=`cd ${qtdir}/..; pwd`
63 moc="`find_in_path moc ${qtdir}/bin`"
64 uic="`find_in_path uic ${qtdir}/bin`"
65 if [ -n "${moc}" ] && [ -n "${uic}" ] ; then
66 tmp="\${QTDIR}/bin ${qtdir}/bin \${PATH} ${PATH}";
67 path=`sort_path ${tmp}`
68 tmp="\${QTDIR}/lib${QT_LD_PREFIX} ${qtdir}/lib${QT_LD_PREFIX} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
69 ld_library_path=`sort_path ${tmp}`
70 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
71 #$DELIM ${PRODUCT_TYPE} $DELIM
74 export LD_LIBRARY_PATH=${ld_library_path}
77 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
85 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
91 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
92 source ${INSTALL_WORK}/$SHRC
94 makedir ${PRODUCT_DIR}
96 check_jb tar xfz ${SOURCE_DIR}/qt-3.3.4.tar.gz -C ${INSTALL_WORK}
98 # apply patch : fix pb of libGL loading
99 if [ -f patches/qt-3.3.3-load-gl.patch ] ; then
100 cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_WORK}
101 ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.3-load-gl.patch )
105 # apply patch for 64-bit platforms
106 if test `uname -m` = "x86_64" ; then
107 if [ -f patches/qt-3.3.4-lib64.patch ] ; then
108 cp patches/qt-3.3.4-lib64.patch ${PRODUCT_WORK}
109 ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.4-lib64.patch )
115 mv -f configure configure-orig
116 sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
119 export QTDIR=${PRODUCT_WORK}
120 export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
123 if test `uname -m` = "x86_64" ; then
124 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++-64"
126 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++"
128 # use system graphics libraries
129 QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -lpng -lmng -ljpeg"
131 # add -dlopen-opengl flag (ONLY if the corresponding patch was applied)
132 if [ "$patched_for_gl" == "yes" ] ; then
133 QT_FLAGS=$QT_FLAGS" -dlopen-opengl"
137 if [ -e /etc/mandriva-release ] ; then
138 version=`cat /etc/mandriva-release | awk '{print $1$4}'`
139 if [ "$version" == "Mandriva2006.0" ] ; then
140 QT_FLAGS=$QT_FLAGS" -plugin-style-cde -plugin-style-compact -plugin-style-motif -plugin-style-motifplus -plugin-style-platinum -plugin-style-sgi"
145 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR}
147 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
148 mv -f _Makefile Makefile
151 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
154 # small trick: INSTALL_ROOT is used inside qt-3.3.3 installation
155 # so it should be set to empty string
156 export INSTALL_ROOT_BACKUP=$INSTALL_ROOT
157 export INSTALL_ROOT=""
158 check_job ${PRODUCT_DIR}/MAKE.LOG make
159 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
161 if test `uname -m` = "x86_64" ; then
162 cd ${PRODUCT_DIR}; ln -sf lib lib64
165 export INSTALL_ROOT=$INSTALL_ROOT_BACKUP
167 for b in `find bin -mindepth 1 -maxdepth 1 -name "*"`; do
169 if [ ! -e ${PRODUCT_DIR}/bin/$b ] || [ -h ${PRODUCT_DIR}/bin/$b ]; then
170 if [ -h ${PRODUCT_DIR}/bin/$b ]; then
171 rm -f ${PRODUCT_DIR}/bin/$b
173 cp -f ${PRODUCT_WORK}/bin/$b ${PRODUCT_DIR}/bin/$b
177 # modify libGL.so flags
178 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
179 gllibdir="`where_gl_libs`"
180 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
182 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
183 ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
184 mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
187 #rm -rf ${PRODUCT_DIR}/doc
189 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
190 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
196 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
197 source ${INSTALL_WORK}/$SHRC
199 check_jb tar xfz ${SOURCE_DIR}/qt-3.3.4.tar.gz -C ${INSTALL_ROOT}
202 cd ${PRODUCT_DIR}/lib
203 sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
204 mv -f libqt-mt.la.new libqt-mt.la
206 # modify libGL.so flags
207 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
208 gllibdir="`where_gl_libs`"
209 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
211 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
212 libqt-mt.la > libqt-mt.la.new
213 mv -f libqt-mt.la.new libqt-mt.la
216 # modify qt package config
217 cd ${PRODUCT_DIR}/lib/pkgconfig
218 sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
219 mv -f qt-mt.pc.new qt-mt.pc
225 export INSTALL_WORK=$2;
226 export SOURCE_DIR=$3;
227 export INSTALL_ROOT=$4;
228 export PRODUCT_SEQUENCE=$5;
229 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qt" ; fi
230 export PRODUCT="qt-3.3.4"
231 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
232 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}