From 3ec78e46765fed5ecad72ad391d92040e6517cee Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 22 Aug 2005 06:52:32 +0000 Subject: [PATCH] Fix a bug of SALOME_PYQT package - to work properly with Sip and PyQt libraries additional SIP flags should be defined depending on existing Qt packages. --- salome_adm/unix/config_files/check_pyqt.m4 | 42 ++++++++++++++++++++++ salome_adm/unix/make_commence.in | 1 + 2 files changed, 43 insertions(+) diff --git a/salome_adm/unix/config_files/check_pyqt.m4 b/salome_adm/unix/config_files/check_pyqt.m4 index 573ebc44f..ee024efaf 100644 --- a/salome_adm/unix/config_files/check_pyqt.m4 +++ b/salome_adm/unix/config_files/check_pyqt.m4 @@ -5,6 +5,9 @@ AC_REQUIRE([CHECK_PYTHON])dnl AC_REQUIRE([CHECK_QT])dnl AC_REQUIRE([CHECK_SIP])dnl +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + AC_ARG_WITH(pyqt, [ --with-pyqt=DIR root directory path to PyQt installation ], [PYQTDIR="$withval" @@ -250,12 +253,51 @@ if test "x$pyqt_sips_ok" == "xno"; then pyqt_ok=no else PYQT_INCLUDES="-I$PYQT_SIPS" + + dnl Additional sip flags required for correct wrappers compilation + AC_MSG_CHECKING(which qt classes should be excluded) + + PYQT_SIPFLAGS="" + + CXXFLAGS_old=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $QT_INCLUDES" + LIBS_old=$LIBS + LIBS="$LIBS $QT_LIBS" + + AC_TRY_COMPILE([#include ], + [new QCDEStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_CDE") + AC_TRY_COMPILE([#include ], + [new QInterlaceStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_INTERLACE") + AC_TRY_COMPILE([#include ], + [new QMotifStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_MOTIF") + AC_TRY_COMPILE([#include ], + [new QMotifPlusStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_MOTIFPLUS") + AC_TRY_COMPILE([#include ], + [new QPlatinumStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_PLATINUM") + AC_TRY_COMPILE([#include ], + [new QSGIStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_SGI") + AC_TRY_COMPILE([#include ], + [new QWindowsStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_WINDOWS") + AC_TRY_COMPILE([#include ], + [new QWindowsXPStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_WINDOWSXP") + + LIBS="$LIBS -lqassistantclient" + AC_TRY_LINK([#include ], + [new QAssistantClient("foo");],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_ASSISTANTCLIENT") + + AC_MSG_RESULT(done) + + CXXFLAGS=$CXXFLAGS_old + LIBS=$LIBS_old fi AC_SUBST(PYQT_INCLUDES) AC_SUBST(PYQT_LIBS) AC_SUBST(PYQT_SIPS) AC_SUBST(PYUIC) +AC_SUBST(PYQT_SIPFLAGS) + +AC_LANG_RESTORE AC_MSG_RESULT(for pyqt: $pyqt_ok) diff --git a/salome_adm/unix/make_commence.in b/salome_adm/unix/make_commence.in index 54932dae1..6d62bc743 100644 --- a/salome_adm/unix/make_commence.in +++ b/salome_adm/unix/make_commence.in @@ -101,6 +101,7 @@ PYQT_SIPS = @PYQT_SIPS@ PYQT_LIBS = @PYQT_LIBS@ PYQT_INCLUDES = @PYQT_INCLUDES@ PYUIC = @PYUIC@ +PYQT_SIPFLAGS = @PYQT_SIPFLAGS@ # openGL OGL_INCLUDES=@OGL_INCLUDES@ -- 2.39.2