cd ${PRODUCT_WORK}
# configure
- if test `uname -m` = "x86_64" ; then
-flags="CFLAGS=-m64 CXXFLAGS=-m64"
-flags="$flags --with-gl-include=/usr/include --with-gl-library=/usr/X11R6/lib64"
-flags="$flags --with-xmu-include=/usr/X11R6/include/X11"
-flags="$flags --with-xmu-library=/usr/X11R6/lib64"
+if test `uname -m` = "x86_64" ; then
+ flags="CFLAGS=-m64 CXXFLAGS=-m64"
+ flags="$flags --with-xmu-include=/usr/X11R6/include/X11"
+ flags="$flags --with-xmu-library=/usr/X11R6/lib64"
else
-flags="--with-gl-include=/usr/include --with-gl-library=/usr/lib"
-flags="$flags --with-xmu-include=/usr/X11R6/include/X11"
-flags="$flags --with-xmu-library=/usr/X11R6/lib"
- fi
+ flags="$flags --with-xmu-include=/usr/X11R6/include/X11"
+ flags="$flags --with-xmu-library=/usr/X11R6/lib"
+fi
+glincdir="`where_gl_includes`"
+if [ $? -eq 0 ] ; then flags="$flags --with-gl-include=$glincdir"; fi
+gllibdir="`where_gl_libs`"
+if [ $? -eq 0 ] ; then flags="$flags --with-gl-library=$gllibdir"; fi
tcldir="`where_tcl`"
if [ $? -eq 0 ] ; then flags="$flags --with-tcl=$tcldir"; fi
tkdir="`where_tk`"
(cd ${PRODUCT_DIR}/inc; ln -fs ../config.h config.h)
# copy resources
makedir ${PRODUCT_DIR}/src
-cp -rp src/UnitsAPI ${PRODUCT_DIR}/src
-cp -rp src/SHMessage ${PRODUCT_DIR}/src
-cp -rp src/FontMFT ${PRODUCT_DIR}/src
-cp -rp src/Textures ${PRODUCT_DIR}/src
-cp -rp src/XSMessage ${PRODUCT_DIR}/src
-cp -rp src/DrawResources ${PRODUCT_DIR}/src
+for d in UnitsAPI SHMessage FontMFT Textures XSMessage DrawResources ; do
+ cp -rp src/${d} ${PRODUCT_DIR}/src
+done
(cd ${PRODUCT_DIR}; mkdir -p Linux; cd Linux; ln -fs ../lib lib; ln -fs ../bin bin)
(cd ${PRODUCT_DIR}; mkdir -p lin; cd lin; ln -fs ../lib lib; ln -fs ../bin bin)
+# fix libGL dependencies
+cd ${PRODUCT_DIR}/lib
+gllibdir="`where_gl_libs`"
+if [ "$gllibdir" != "" ] ; then
+ if [ -f ${gllibdir}/libGL.la ] ; then
+ libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
+ if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then
+ str_to_replace="${gllibdir}/libGL.la"
+ fi
+ fi
+ if [ "$str_to_replace" == "" ] ; then
+ str_to_replace="-L${gllibdir} -lGL"
+ fi
+ sed -e "s%-lGL%%g" \
+ -e "s%[^[:space:]]*libGL.la[[:space:]]%%g" \
+ -e "s%^dependency_libs='\(.*\)%dependency_libs='${str_to_replace} \1%" \
+ libTKOpenGl.la > libTKOpenGl.la.new
+ mv -f libTKOpenGl.la.new libTKOpenGl.la
+fi
+
#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
print_env
source ${INSTALL_WORK}/$SHRC
check_jb tar xfz ${SOURCE_DIR}/CAS-6.1.2a2.tar.gz -C ${INSTALL_ROOT}
+
+# modify *.la files
ldir=${PRODUCT_DIR}/lib
if [ ! -d $ldir ]; then ldir=${PRODUCT_DIR}/Linux/lib; fi
if [ ! -d $ldir ]; then ldir=${PRODUCT_DIR}/lin/lib; fi
cd $ldir
+# 1. set libdir correctly, correct dependencies, set tcldir correctly
tcldir=`printenv TCLHOME`
for l in X `find . -name "*.la"`; do
if [ "$l" != "X" ] ; then
fi
done
+# 2. fix libGL dependencies
+cd $ldir
+gllibdir="`where_gl_libs`"
+if [ "$gllibdir" != "" ] ; then
+ if [ -f ${gllibdir}/libGL.la ] ; then
+ libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
+ if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then
+ str_to_replace="${gllibdir}/libGL.la"
+ fi
+ fi
+ if [ "$str_to_replace" == "" ] ; then
+ str_to_replace="-L${gllibdir} -lGL"
+ fi
+ sed -e "s%-lGL%%g" \
+ -e "s%[^[:space:]]*libGL.la[[:space:]]%%g" \
+ -e "s%^dependency_libs='\(.*\)%dependency_libs='${str_to_replace} \1%" \
+ libTKOpenGl.la > libTKOpenGl.la.new
+ mv -f libTKOpenGl.la.new libTKOpenGl.la
+fi
+
print_env
}
cp -f ${PRODUCT_WORK}/bin/$b ${PRODUCT_DIR}/bin/$b
fi
done
+
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
+gllibdir="`where_gl_libs`"
+if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
+ sed -e "s%-lGL%%g" \
+ -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
+ ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
+ mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
+fi
+
#rm -rf ${PRODUCT_DIR}/doc
#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
check_jb tar xfz ${SOURCE_DIR}/qt-3.3.3.tar.gz -C ${INSTALL_ROOT}
cd ${PRODUCT_DIR}/lib
+
+# modify libdir
sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
mv -f libqt-mt.la.new libqt-mt.la
+
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
+gllibdir="`where_gl_libs`"
+if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
+ sed -e "s%-lGL%%g" \
+ -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
+ libqt-mt.la > libqt-mt.la.new
+ mv -f libqt-mt.la.new libqt-mt.la
+fi
+
+# modify qt package config
cd ${PRODUCT_DIR}/lib/pkgconfig
sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
mv -f qt-mt.pc.new qt-mt.pc
cp -f ${PRODUCT_WORK}/bin/$b ${PRODUCT_DIR}/bin/$b
fi
done
+
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
+gllibdir="`where_gl_libs`"
+if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
+ sed -e "s%-lGL%%g" \
+ -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
+ ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
+ mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
+fi
+
#rm -rf ${PRODUCT_DIR}/doc
#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
check_jb tar xfz ${SOURCE_DIR}/qt-3.3.4.tar.gz -C ${INSTALL_ROOT}
+# modify libdir
cd ${PRODUCT_DIR}/lib
sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
mv -f libqt-mt.la.new libqt-mt.la
+
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
+gllibdir="`where_gl_libs`"
+if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
+ sed -e "s%-lGL%%g" \
+ -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
+ libqt-mt.la > libqt-mt.la.new
+ mv -f libqt-mt.la.new libqt-mt.la
+fi
+
+# modify qt package config
cd ${PRODUCT_DIR}/lib/pkgconfig
sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
mv -f qt-mt.pc.new qt-mt.pc