Salome HOME
Provide native qwt 4.2.0 support on Mandriva 2006.0
authorvsr <vsr@opencascade.com>
Tue, 23 May 2006 08:07:19 +0000 (08:07 +0000)
committervsr <vsr@opencascade.com>
Tue, 23 May 2006 08:07:19 +0000 (08:07 +0000)
config_Mandriva_2006.0.xml
config_files/qwt-4.2.0.sh

index 463eeedddb9cbb961d5db215f902078bc8cb0fc0..c47abb1d88284aa74cc306b4d4c3685c129cf583 100755 (executable)
            version="4.2.0" 
            description="2-D plotting extension for Qt library"
            install="install binaries"
-          supported="install sources,install binaries"
+          supported="use native,install sources,install binaries"
           disable="false"
           dependancies="gcc,Qt"
           installdiskspace="995"
index 88f5b2d2768c532ad91f07a9acf4bd845a26d983..0a2a6baa47487796caabdef9c3d3386450afcaee 100755 (executable)
@@ -2,10 +2,16 @@
 
 check_version()
 {
-if [ -n "${QWTHOME}" ]; then
-    check_lib_version libqwt.so.4.2.0 ${QWTHOME}/lib
-    if [ "$?" -eq "0" ]; then
-       return 0
+if [ -n "${QWTHOME}" ] ; then 
+    qwtinc=${QWTHOME}/include/qwt_global.h
+    if [ ! -f $qwtinc ] ; then
+       qwtinc=${QWTHOME}/include/qwt/qwt_global.h
+    fi
+    if [ -f $qwtinc ] ; then
+       ver=`grep -e "^#define[[:space:]]\+QWT_VERSION_STR" $qwtinc | sed -e 's/^#define[[:space:]]\+QWT_VERSION_STR[[:space:]]*"\(.*\)"/\1/'`
+       if [ "$ver" == "4.2.0" ]; then
+           return 0
+       fi
     fi
 fi
 return 1
@@ -25,20 +31,24 @@ make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
 
 # looks for the native product and collects it's environment (used by make_env())
 try_native(){
-qwthome="`find_in_path libqwt.so.4.2.0 ${LD_LIBRARY_PATH}`"
-if [ -z "${qwthome}" ] ; then
-    qwthome="`find_in_path libqwt.so.4.2.0 /usr/lib`"
-fi
+qwthome="`find_in_path libqwt.so ${LD_LIBRARY_PATH}:/usr/lib:/usr/local/lib`"
 if [ -n "${qwthome}" ] ; then
-    tmp="${qwthome} ${qwthome} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
-    ld_library_path=`sort_path ${tmp}`
-    cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+    qwtroot=`cd ${qwthome}/..; pwd`
+    qwtinc="`find_in_path qwt_global.h ${qwtroot}/include:${qwtroot}/include/qwt:${QTDIR}/include/qwt:/usr/lib/qt3/include/qwt:/usr/local/lib/qt3/include/qwt`"
+    if [ -n "${qwtinc}" ] ; then
+       ver=`grep -e "^#define[[:space:]]\+QWT_VERSION_STR" ${qwtinc}/qwt_global.h | sed -e 's/^#define[[:space:]]\+QWT_VERSION_STR[[:space:]]*"\(.*\)"/\1/'`
+       if [ "$ver" == "4.2.0" ]; then
+           tmp="${qwthome} ${qwthome} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
+           ld_library_path=`sort_path ${tmp}`
+           cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
 #$DELIM ${PRODUCT_TYPE} $DELIM
 export LD_LIBRARY_PATH=${ld_library_path}
 ##
 EOF
-    make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
-    return 0
+           make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+           return 0
+       fi
+    fi
 fi
 return 1
 }