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}" "${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}
75 # apply patch : fix pb of libGL loading
76 if [ -f patches/qt-3.3.3-load-gl.patch ] ; then
77 cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_DIR}_SRC
78 ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < qt-3.3.3-load-gl.patch )
82 # apply patch for 64-bit platforms
83 if test `uname -m` = "x86_64" ; then
84 if [ -f patches/qt-3.3.4-lib64.patch ] ; then
85 cp patches/qt-3.3.4-lib64.patch ${PRODUCT_DIR}_SRC
86 ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < qt-3.3.4-lib64.patch )
92 mv -f configure configure-orig
93 sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
96 export QTDIR=${PRODUCT_DIR}_SRC
97 export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
100 if test `uname -m` = "x86_64" ; then
101 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++-64"
103 QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++"
105 # use system graphics libraries
106 QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -lpng -lmng -ljpeg"
108 # add -dlopen-opengl flag (ONLY if the corresponding patch was applied)
109 if [ "$patched_for_gl" == "yes" ] ; then
110 QT_FLAGS=$QT_FLAGS" -dlopen-opengl"
114 if [ -e /etc/mandriva-release ] ; then
115 version=`cat /etc/mandriva-release | awk '{print $1$4}'`
116 if [ "$version" == "Mandriva2006.0" ] ; then
117 QT_FLAGS=$QT_FLAGS" -plugin-style-cde -plugin-style-compact -plugin-style-motif -plugin-style-motifplus -plugin-style-platinum -plugin-style-sgi"
122 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR}
124 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
125 mv -f _Makefile Makefile
128 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
131 # small trick: INSTALL_ROOT is used inside qt-3.3.3 installation
132 # so it should be set to empty string
133 export INSTALL_ROOT_BACKUP=$INSTALL_ROOT
134 export INSTALL_ROOT=""
135 check_job ${PRODUCT_DIR}/MAKE.LOG make
136 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
138 if test `uname -m` = "x86_64" ; then
139 cd ${PRODUCT_DIR}; ln -sf lib lib64
142 export INSTALL_ROOT=$INSTALL_ROOT_BACKUP
144 for b in `find bin -mindepth 1 -maxdepth 1 -name "*"`; do
146 if [ ! -e ${PRODUCT_DIR}/bin/$b ] || [ -h ${PRODUCT_DIR}/bin/$b ]; then
147 if [ -h ${PRODUCT_DIR}/bin/$b ]; then
148 rm -f ${PRODUCT_DIR}/bin/$b
150 cp -f ${PRODUCT_DIR}_SRC/bin/$b ${PRODUCT_DIR}/bin/$b
154 # modify libGL.so flags
155 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
156 gllibdir="`where_gl_libs`"
157 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
159 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
160 ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
161 mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
164 #rm -rf ${PRODUCT_DIR}/doc
166 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
169 # remove sources and temporary files after building
170 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
171 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
174 # to generate environment scripts
180 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
181 source ${INSTALL_WORK}/$SHRC
183 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
186 cd ${PRODUCT_DIR}/lib
187 sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
188 mv -f libqt-mt.la.new libqt-mt.la
190 # modify libGL.so flags
191 has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
192 gllibdir="`where_gl_libs`"
193 if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
195 -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
196 libqt-mt.la > libqt-mt.la.new
197 mv -f libqt-mt.la.new libqt-mt.la
200 # modify qt package config
201 cd ${PRODUCT_DIR}/lib/pkgconfig
202 sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
203 mv -f qt-mt.pc.new qt-mt.pc
205 # to generate environment scripts
210 export INSTALL_WORK=$2;
211 export SOURCE_DIR=$3;
212 export INSTALL_ROOT=$4;
213 export PRODUCT_SEQUENCE=$5;
214 export PRODUCT_TYPE=$6;
215 export INSTALL_PRODUCTS=$7;
218 export PRODUCT="qt-3.3.4"
219 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
220 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}