]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
NRI : Merge from V1_2.
authornri <nri@opencascade.com>
Thu, 10 Jul 2003 12:37:46 +0000 (12:37 +0000)
committernri <nri@opencascade.com>
Thu, 10 Jul 2003 12:37:46 +0000 (12:37 +0000)
salome_adm/unix/config_files/check_pyqt.m4

index 98f92b12155a316ea7f47eab9c3fbaacdb4589ce..09d4e426c71f7353d00f17c5851e8295f4ec9d9d 100644 (file)
@@ -5,7 +5,7 @@ AC_REQUIRE([CHECK_PYTHON])dnl
 
 AC_CHECKING(for pyqt)
 
-pyqt_ok=yes
+pyqt_ok=no
 
 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)
@@ -25,95 +25,96 @@ if test "x$pyqt_ok" = xyes ; then
    AC_MSG_RESULT(yes)
 else
 
+  pyqt_ok=yes
   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_ok=no
-
-    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
-
-  AC_ARG_WITH(pyuic,
+AC_ARG_WITH(pyqt,
+    [  --with-pyqt=DIR      root directory path to PyQt installation ],
+    [PYQTDIR="$withval"
+      AC_MSG_RESULT("select $withval as path to PyQt")
+    ])
+
+AC_ARG_WITH(pyqt_sips,
+    [  --with-pyqt_sips=DIR      a directory path to PyQt sips installation ],
+    [PYQT_SIPS="$withval"
+      AC_MSG_RESULT("select $withval as path to PyQt sips")
+    ])
+
+
+AC_ARG_WITH(pyuic,
     [  --with-pyuic=EXEC pyuic executable ],
     [PYUIC="$withval"
       AC_MSG_RESULT("select $withval as pyqt executable")
     ])
 
-  if test "x$PYUIC" = "x"
-  then
-    pyqt_ok=no
-    AC_MSG_RESULT(pyuic not in PATH variable)
-  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
-  fi
-
-  AC_SUBST(PYUIC)
-  AC_SUBST(PYQT_SIPS)
-
-  AC_MSG_RESULT(for pyqt: $pyqt_ok)
+
+if test -z $PYQTDIR; then
+   PYQTDIR="/usr/lib/python${PYTHON_VERSION}/site-packages"    
+else
+   if test -z $PYQT_SIPS; then
+      PYQT_SIPS="$PYQTDIR/sip" 
+   fi  
+   if test -z $PYUIC; then
+      AC_CHECK_FILE("$PYQTDIR/pyuic",pyqt_ok=yes,pyqt_ok=no)
+      if test "x$pyqt_ok" = xyes ; then        
+         PYUIC="$PYQTDIR/pyuic"
+      else
+         AC_PATH_PROG(PYUIC, pyuic)
+      fi       
+   fi  
+fi
+
+if test -z $PYQT_SIPS; then
+   PYQT_SIPS="/usr/share/sip/qt"       
+fi
+
+if test -z $PYUIC; then
+   PYUIC="/usr/bin/pyuic"      
 fi
 
+AC_CHECK_FILES("$PYQTDIR/qt.py","$PYQTDIR/qt/qt.py",pyqt_ok=yes,pyqt_ok=no)
+if test "x$pyqt_ok" = xno ; then
+   AC_MSG_RESULT(no)
+   AC_MSG_WARN(pyqt not found)
+else
+   AC_CHECK_FILE("$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)
+   else
+      PYQT_ROOT=$PYQTDIR
+      PYQT_LIBS="-L$PYQTDIR -lqtcmodule"
+   fi
+   AC_CHECK_FILE("$PYQT_SIPS/copying.sip",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_INCLUDES="-I$PYQT_SIPS"
+   fi
+
+   AC_SUBST(PYQT_ROOT)
+   AC_SUBST(PYQT_INCLUDES)
+   AC_SUBST(PYQT_LIBS)
+
+   AC_MSG_RESULT(yes)
+fi
+
+PYQT_ROOT=$PYQTDIR
+PYQT_INCLUDES="-I$PYQT_SIPS"
+PYQT_LIBS="-L$PYQTDIR -lqtcmodule"
+
+AC_SUBST(PYQT_ROOT)
+AC_SUBST(PYQT_INCLUDES)
+AC_SUBST(PYUIC)
+AC_SUBST(PYQT_SIPS)
+AC_SUBST(PYQT_LIBS)
+
+
+
+AC_MSG_RESULT(for pyqt: $pyqt_ok)
+
+fi
 ])dnl
 dnl