]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
improve the way to detect QWTHOME and QWT_INCLUDES
authoradam <adam>
Fri, 3 Jun 2005 07:16:20 +0000 (07:16 +0000)
committeradam <adam>
Fri, 3 Jun 2005 07:16:20 +0000 (07:16 +0000)
add mandrake 10.2 support (qwt.h in /usr/lib/qt3/include/qwt)

salome_adm/unix/config_files/check_qwt.m4

index 21b15fa3a5dac7c0fe2d3b7f35ea61316db817ac..c8537dae707b8de035bd821b2522548a7449cf7c 100644 (file)
@@ -23,24 +23,45 @@ AC_ARG_WITH(qwt_inc,
 
 if test -z $QWTHOME; then
   AC_MSG_RESULT(QWTHOME not defined)
+  dnl E.A. : Trying to detect QWTHOME
   exits_ok=no  
-  AC_CHECK_FILE("/usr/local/lib/libqwt.so",exits_ok=yes,exits_ok=no)
+  if test "x$exits_ok" = "xno"; then
+     dnl E.A. : Searching for libqwt.so in usual system paths
+     for d in /usr/local /usr ; do
+        AC_CHECK_FILE(${d}/lib/libqwt.so,exits_ok=yes,exits_ok=no)
+        if test "x$exits_ok" = "xyes"; then
+           QWTHOME=$d
+           AC_MSG_RESULT(libqwt.so detected in $d/lib)
+           break
+        fi
+     done
+  fi
+  if test "x$exits_ok" = "xno"; then
+     dnl E.A. : Searching for libqwt.so in LD_LIBRARY_PATH
+     for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
+        if test -f $d/libqwt.so ; then
+           AC_MSG_RESULT(libqwt.so detected in $d)
+           QWTHOME=$d
+           QWTHOME=`echo ${QWTHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+           exits_ok=yes
+           break
+        fi
+     done
+  fi
+  dnl E.A. : Trying to find QWT_INCLUDES
   if test "x$exits_ok" = "xyes"; then
-     QWTHOME="/usr/local/lib"    
-     AC_MSG_RESULT(libqwt.so detected in /usr/local/lib)
      if test -z $QWT_INCLUDES; then
-        QWT_INCLUDES="/usr/local/include/qwt"
+       dnl E.A. : /usr/lib/qt3/include/qwt for mandrake 10.2 qwt rpm
+       for d in ${QWTHOME}/include/qwt ${QWTHOME}/include /usr/lib/qt3/include/qwt ; do
+           AC_CHECK_FILE(${d}/qwt.h,exits_ok=yes,exits_ok=no)
+           if test "x$exits_ok" = "xyes"; then
+              QWT_INCLUDES=$d
+              AC_MSG_RESULT(qwt.h detected in $d)
+              break
+           fi
+        done
      fi
-  else
-     AC_CHECK_FILE("/usr/lib/libqwt.so",exits_ok=yes,exits_ok=no)
-     if test "x$exits_ok" = "xyes"; then
-       QWTHOME="/usr/lib"   
-       AC_MSG_RESULT(libqwt.so detected in /usr/lib)
-         if test -z $QWT_INCLUDES; then
-           QWT_INCLUDES="/usr/include/qwt"
-         fi
-       fi
-  fi   
+  fi
 else
   if test -z $QWT_INCLUDES; then
      QWT_INCLUDES="$QWTHOME/include"