]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: merge branch CCAR_br1 + specific RedHat 8.0
authorprascle <prascle>
Mon, 16 Jun 2003 13:58:44 +0000 (13:58 +0000)
committerprascle <prascle>
Mon, 16 Jun 2003 13:58:44 +0000 (13:58 +0000)
salome_adm/unix/config_files/check_pyqt.m4

index ec915a4ad412e783ea4d7ec56066696225bd73f1..fa1f91dbceaa18087a4936ab900b5d959cfd58f8 100644 (file)
@@ -6,36 +6,89 @@ AC_CHECKING(for pyqt)
 
 pyqt_ok=no
 
-dnl were is pyqt ?
-
-if test -z $PYQTDIR; then
-  AC_MSG_WARN(You must provide PYQTDIR variable)
-else
-  pyqt_ok=yes
+PYTHON_SITE_PACKPYQT=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
+AC_CHECK_FILES($PYTHON_SITE_PACKPYQT/qt.py $PYTHON_SITE_PACKPYQT/libqtcmodule.so,pyqt_ok=yes,pyqt_ok=no)
+if test "x$pyqt_ok" = xyes ; then
+   PYQT_INCLUDES="-I $PYTHON_SITE_PACKPYQT"
+   PYQT_LIBS="-L$PYTHON_SITE_PACKPYQT -lqtcmodule"
 fi
 
-if test "x$pyqt_ok" = xno -o ! -d "$PYQTDIR" -o ! -d "$PYQTDIR"/sip ; then
-  AC_MSG_RESULT(no)
-  AC_MSG_WARN(pyqt not found)
+if test "x$pyqt_ok" = xyes ; then
+   AC_CHECK_FILES(/usr/share/sip/qt/qtmod.sip,pyqt_ok=yes,pyqt_ok=no)
+   if test "x$pyqt_ok" = xyes ; then
+      PYQT_SIPS="/usr/share/sip/qt"
+   fi
+   AC_SUBST(PYQT_INCLUDES)
+   AC_SUBST(PYQT_LIBS)
+   AC_SUBST(PYQT_SIPS)
+   AC_MSG_RESULT(yes)
 else
-  AC_CHECK_FILES("$PYQTDIR"/qt.py "$PYQTDIR"/libqtcmodule.so,pyqt_ok=yes,pyqt_ok=no) 
-  if test "x$pyqt_ok" = xno ; then
-     AC_MSG_RESULT(no)
-     AC_MSG_WARN(pyqt not found)
+
+  dnl were is pyqt ?
+
+  if test -z $PYQTDIR; then
+    AC_MSG_WARN(You must provide PYQTDIR variable)
+  else
+    pyqt_ok=yes
+  fi
+
+  version=`python -c "import qt;print qt.PYQT_VERSION"`
+  case "$version" in
+     3.2*)
+       pyqt_vers=old ;;
+     3.3*)
+       pyqt_vers=old ;;
+     3.4*)
+       pyqt_vers=new ;;
+     3.5*)
+       pyqt_vers=new ;;
+        *)
+       pyqt_vers=no ;;
+  esac
+
+  if test "x$pyqt_ok" = xno -o ! -d "$PYQTDIR" ; then
+    AC_MSG_RESULT(no)
+    AC_MSG_WARN(pyqt not found)
   else
-     PYQT_ROOT=$PYQTDIR
-     PYQT_INCLUDES="-I$PYQTDIR/sip"
-     PYQT_LIBS="-L$PYQTDIR -lqtcmodule"
 
-     AC_SUBST(PYQT_ROOT)
-     AC_SUBST(PYQT_INCLUDES)
-     AC_SUBST(PYQT_LIBS)
+    pyqt_ok=no
 
-     AC_MSG_RESULT(yes)
+    if test "x$pyqt_vers" = "xold"
+    then
+        AC_CHECK_FILES("$PYQTDIR"/qt.py "$PYQTDIR"/libqtcmodule.so,pyqt_ok=yes,pyqt_ok=no) 
+        if test "x$pyqt_ok" = xno -o ! -d "$PYQTDIR"/sip ; then
+           AC_MSG_RESULT(no)
+           AC_MSG_WARN(pyqt not found)
+        else
+           PYQT_ROOT=$PYQTDIR
+           PYQT_INCLUDES="-I$PYQTDIR/sip"
+          PYQT_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -L$PYQTDIR -lqtcmodule"
+           AC_SUBST(PYQT_ROOT)
+           AC_SUBST(PYQT_INCLUDES)
+           AC_SUBST(PYQT_LIBS)
+           AC_MSG_RESULT(yes)
+        fi
+    fi
+
+    if test "x$pyqt_vers" = "xnew"
+    then
+        AC_CHECK_FILES("$PYQTDIR"/lib/qt.py "$PYQTDIR"/lib/libqtcmodule.so,pyqt_ok=yes,pyqt_ok=no) 
+        if test "x$pyqt_ok" = xno ; then
+           AC_MSG_RESULT(no)
+           AC_MSG_WARN(pyqt not found)
+        else
+           PYQT_ROOT=$PYQTDIR
+           PYQT_INCLUDES="-I$PYQTDIR/sip"
+           PYQT_LIBS="-L$PYQTDIR/lib -lqtcmodule"
+           AC_SUBST(PYQT_ROOT)
+           AC_SUBST(PYQT_INCLUDES)
+           AC_SUBST(PYQT_LIBS)
+           AC_MSG_RESULT(yes)
+        fi
+    fi
   fi
-fi
 
-AC_ARG_WITH(pyuic,
+  AC_ARG_WITH(pyuic,
     [  --with-pyuic=EXEC pyuic executable ],
     [PYUIC="$withval"
       AC_MSG_RESULT("select $withval as pyqt executable")
@@ -43,27 +96,24 @@ AC_ARG_WITH(pyuic,
       AC_PATH_PROG(PYUIC, pyuic)
     ])
 
-if test "x$PYUIC" = "x"
-then
+  if test "x$PYUIC" = "x"
+  then
     pyqt_ok=no
     AC_MSG_RESULT(pyuic not in PATH variable)
-else
+  else
        if test -z $PYQT_SIPS; then
          AC_MSG_WARN(You must provide PYQT_SIPS variable)
          pyqt_ok=no
        else
          PYQT_SIPS=${PYQT_SIPS}
        fi
-       PYQT_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages ${PYQT_LIBS}"
-fi
-
-AC_SUBST(PYUIC)
-AC_SUBST(PYQT_SIPS)
-AC_SUBST(PYQT_LIBS)
-
+  fi
 
+  AC_SUBST(PYUIC)
+  AC_SUBST(PYQT_SIPS)
 
-AC_MSG_RESULT(for pyqt: $pyqt_ok)
+  AC_MSG_RESULT(for pyqt: $pyqt_ok)
+fi
 
 ])dnl
 dnl