From: vsr Date: Fri, 15 Nov 2013 06:10:23 +0000 (+0000) Subject: Adopt to new environment (there can be no QTDIR, but QT4_ROOT_DIR instead). X-Git-Tag: V7_3_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4acfe89c6aec30b201891e61895b2d923d694d62;p=tools%2Fhxx2salome.git Adopt to new environment (there can be no QTDIR, but QT4_ROOT_DIR instead). --- diff --git a/config_files/check_qt.m4 b/config_files/check_qt.m4 index 2c9d2b9..b8d89b5 100644 --- a/config_files/check_qt.m4 +++ b/config_files/check_qt.m4 @@ -26,8 +26,8 @@ dnl AC_DEFUN([OPTIONS_QT], [ AC_ARG_WITH([qt], [AC_HELP_STRING([--with-qt], [Possible usage: - "Qt_Install_Path" - prefix to path where Qt was installd; - "" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QTDIR and then - standard system paths ); + "Qt_Install_Path" - prefix to path where Qt was installed; + "" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QT4_ROOT_DIR or $QTDIR and then - standard system paths); "no" - not use Qt product (is not supported) By default "" option is used)])], [with_qt=$withval], [with_qt=""]) @@ -51,7 +51,10 @@ fi qt_ok=yes -QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%') +QT_DIR=$(echo $QT4_ROOT_DIR | sed 's%[/]\+$%%') +if test -z $QT_DIR ; then + QT_DIR=$(echo $QTDIR | sed 's%[/]\+$%%') +fi AC_LANG_SAVE AC_LANG_CPLUSPLUS @@ -76,31 +79,31 @@ fi if test "x$with_qt" != "x" ; then dnl Using "--with-qt" prefix path - QTDIR="$with_qt" -elif test "$QTDIR" = "/usr/lib/qt3" ; then - dnl Using QTDIR environment variable - AC_MSG_RESULT(current QTDIR is $QTDIR) + QT_DIR="$with_qt" +elif test "$QT_DIR" = "/usr/lib/qt3" ; then + dnl Using QTDIR/QT4_ROOT_DIR environment variable + AC_MSG_RESULT(current QTDIR is $QT_DIR) dnl if test -d /usr/lib/qt4 ; then AC_MSG_RESULT(it is strange for a qt4 installation !) AC_MSG_RESULT(/usr/lib/qt4 is present) AC_MSG_RESULT(replacing QTDIR by /usr/lib/qt4) - QTDIR=/usr/lib/qt4 + QT_DIR=/usr/lib/qt4 fi -elif test -z $QTDIR ; then - AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed) +elif test -z $QT_DIR ; then + AC_MSG_WARN(undefined both QTDIR and Qt4_ROOT_DIR variables; any of them should specify where Qt product was installed) for d in /usr/local/lib/qt4 /usr/lib/qt4 /usr ; do if test -f ${d}/lib/libQtCore.so ; then AC_MSG_RESULT(trying ${d}) - QTDIR="${d}" + QT_DIR="${d}" break elif test -f ${d}/lib64/libQtCore.so ; then AC_MSG_RESULT(trying ${d}) - QTDIR="${d}" + QT_DIR="${d}" break elif test -f ${d}/libQtCore.so ; then AC_MSG_RESULT(trying ${d}) - QTDIR="${d}" + QT_DIR="${d}" break fi done @@ -109,9 +112,9 @@ fi # # check QTDIR environment variable # -if test "x$QTDIR" = "x" +if test "x$QT_DIR" = "x" then - AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable) + AC_MSG_RESULT([Please define correct path in "--with-qt" option or use correct $QTDIR (or, alternatively, $QT4_ROOT_DIR) variable]) qt_ok=no fi @@ -122,17 +125,17 @@ if test "x$qt_ok" = "xyes" then qt_inc_ok=no QTINC="" - AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="") + AC_CHECK_FILE(${QT_DIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="") if test "x$QTINC" = "x" then - AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no) + AC_CHECK_FILE(${QT_DIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no) else qt_inc_ok=yes fi if test "x$qt_inc_ok" = "xyes" then AC_MSG_CHECKING(whether Qt version >= 4.0) - QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'` + QT_VERSION=`grep "QT_VERSION_STR" ${QT_DIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'` QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'` if test $QT_VERSION_ID -ge 40000 then @@ -153,9 +156,9 @@ fi # if test "x$qt_ok" = "xyes" then - if test -f ${QTDIR}/bin/moc + if test -f ${QT_DIR}/bin/moc then - MOC=${QTDIR}/bin/moc + MOC=${QT_DIR}/bin/moc else AC_PATH_PROG(MOC, moc) fi @@ -189,9 +192,9 @@ fi # if test "x$qt_ok" = "xyes" then - if test -f ${QTDIR}/bin/uic + if test -f ${QT_DIR}/bin/uic then - UIC=${QTDIR}/bin/uic + UIC=${QT_DIR}/bin/uic else AC_PATH_PROG(UIC, uic) fi @@ -210,9 +213,9 @@ fi # if test "x$qt_ok" = "xyes" then - if test -f ${QTDIR}/bin/rcc + if test -f ${QT_DIR}/bin/rcc then - QRCC=${QTDIR}/bin/rcc + QRCC=${QT_DIR}/bin/rcc else AC_PATH_PROG(QRCC, rcc) fi @@ -246,9 +249,9 @@ fi # if test "x$qt_ok" = "xyes" then - if test -f ${QTDIR}/bin/lrelease + if test -f ${QT_DIR}/bin/lrelease then - LRELEASE=${QTDIR}/bin/lrelease + LRELEASE=${QT_DIR}/bin/lrelease else AC_PATH_PROG(LRELEASE, lrelease) fi @@ -277,7 +280,7 @@ then fi fi -QT_ROOT=$QTDIR +QT_ROOT=$QT_DIR # # check Qt header files @@ -287,34 +290,34 @@ then AC_CHECKING(include Qt header files) CPPFLAGS_old=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore" + CPPFLAGS="$CPPFLAGS -I${QT_DIR}/include${QTINC} -I${QT_DIR}/include${QTINC}/QtCore" AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no) CPPFLAGS=$CPPFLAGS_old if test "x$qt_ok" = "xno" then - AC_MSG_RESULT(qt header files are not found in $QTDIR/include${QTINC}/QtCore) + AC_MSG_RESULT(qt header files are not found in $QT_DIR/include${QTINC}/QtCore) AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version)) else AC_MSG_RESULT(qt header files seem to be OK) - QT_INCLUDES="-I${QTDIR}/include${QTINC}" + QT_INCLUDES="-I${QT_DIR}/include${QTINC}" # user header files - QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtCore" - QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtGui" - QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtOpenGL" - QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtXml" + QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtCore" + QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtGui" + QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtOpenGL" + QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtXml" # not used currently header files (uncomment if required) - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtAssistant" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDBus" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDesigner" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtNetwork" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSql" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSvg" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtTest" - #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtUiTools" - - QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtAssistant" - QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtNetwork" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtAssistant" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtDBus" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtDesigner" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtNetwork" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtSql" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtSvg" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtTest" + #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtUiTools" + + QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtAssistant" + QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtNetwork" # this flag is obsolete with Qt 4 QT_MT_INCLUDES="$QT_INCLUDES" @@ -332,13 +335,13 @@ then CXXFLAGS="$CXXFLAGS $QT_INCLUDES" LIBS_old=$LIBS - if test "x$QTDIR" = "x/usr" ; then + if test "x$QT_DIR" = "x/usr" ; then QT_LIB_DIR="" - elif test -d ${QTDIR}/lib; then - QT_LIB_DIR="-L$QTDIR/lib" - elif test -d ${QTDIR}/lib64; then - QT_LIB_DIR="-L$QTDIR/lib64" - elif test "x$QTDIR" = "x/usr/lib/qt4" ; then + elif test -d ${QT_DIR}/lib; then + QT_LIB_DIR="-L$QT_DIR/lib" + elif test -d ${QT_DIR}/lib64; then + QT_LIB_DIR="-L$QT_DIR/lib64" + elif test "x$QT_DIR" = "x/usr/lib/qt4" ; then QT_LIB_DIR="" else AC_MSG_ERROR(Can't detect of Qt library directory ) @@ -360,7 +363,7 @@ then # BEGIN: for CCRT (installation of qt have only a "lib" directory) if test "x$qt_ok" = "xno" then - QT_LIB_DIR="-L$QTDIR/lib" + QT_LIB_DIR="-L$QT_DIR/lib" LIBS="$LIBS_old $QT_LIB_DIR -lQtCore" AC_CACHE_VAL(salome_cv_lib_qt,[ @@ -401,7 +404,7 @@ then CXXFLAGS=$CXXFLAGS_old fi -AC_SUBST(QTDIR) +AC_SUBST(QT_DIR) AC_SUBST(MOC) AC_SUBST(UIC) AC_SUBST(QRCC)