From 0a80cfd57d271dd44221467efb426675fa470356 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 18:31:12 +0000 Subject: TQt4 port kvirc This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- admin/acinclude.m4.in | 131 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 85 insertions(+), 46 deletions(-) (limited to 'admin') diff --git a/admin/acinclude.m4.in b/admin/acinclude.m4.in index bcb1ce14..89ab7a77 100644 --- a/admin/acinclude.m4.in +++ b/admin/acinclude.m4.in @@ -1589,30 +1589,46 @@ AC_DEFUN([AC_SS_FIND_QT3_INCLUDE_DIR], AC_SS_FIND_FILE_PATH($SS_QT3_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT3_INCDIR) if test "$SS_QT3_INCDIR" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the qt 3.x header files." - echo "### Make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### Try to run configure again, this time passing the --with-qt-include-dir" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) + + dnl HACK HACK HACK + + ss_qt_include_test_dirs="$SS_QT4_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/include/qt4 /usr/qt4/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11" + test -n "$QTDIR" && ss_qt_include_test_dirs="$QTDIR/include $QTDIR $ss_qt_include_test_dirs" + ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt4 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include" + ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT4_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED" + ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED" + ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT4_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt" + + AC_SS_FIND_FILE_PATH($SS_QT4_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT4_INCDIR) + + SS_QT3_INCDIR="$SS_QT4_INCDIR -include tqt.h" + AC_MSG_RESULT([TQt4 detected--Qt4 found in $SS_QT3_INCDIR]) + +dnl AC_MSG_RESULT([FAILED]) +dnl AC_SS_SET_REDINK +dnl echo "################################################################################" +dnl echo "### CONFIGURE ERROR:" +dnl echo "### Can not find the qt 3.x header files." +dnl echo "### Make sure that qt is correctly installed on your system," +dnl echo "### and the qt version is the one requested by this version of kvirc." +dnl echo "### Try to run configure again, this time passing the --with-qt-include-dir" +dnl echo "### option (see ./configure --help)." +dnl echo "### You may also take a look at the config.log file in this directory," +dnl echo "### that will tell you which check has failed and maybe more about the reason" +dnl echo "### of the failure." +dnl echo "### If you're feeling that this may be a bug in this configure script" +dnl echo "### and want to report this to me , please include your configure script," +dnl echo "### the config.log file as well as the complete configure output." +dnl echo "################################################################################" +dnl AC_SS_SET_NORMALINK +dnl AC_MSG_ERROR([This was a fatal one...aborting]) else AC_MSG_RESULT([found in $SS_QT3_INCDIR]) fi else AC_MSG_RESULT([using user supplied path for the Qt 3.x include files $SS_QT3_INCDIR]) + SS_QT3_INCDIR="$SS_QT3_INCDIR -include tqt.h" fi ]) @@ -1696,27 +1712,53 @@ AC_DEFUN([AC_SS_FIND_QT3_LIBRARY_DIR], AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT3_LIBDIR) if test "$SS_QT3_LIBDIR" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the qt 3.x library file." - echo "### Make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### (Usually a greater version is OK too)" - echo "### Try to run configure again, this time passing the --with-qt-library-dir" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) + + dnl HACK HACK HACK + + AC_MSG_CHECKING([for the Qt 4.x libraries]) + + ss_qt_library_test_dirs="$SS_QT4_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib" + test -n "$QTDIR" && ss_qt_library_test_dirs="$QTDIR/lib $QTDIR $ss_qt_library_test_dirs" + ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib" + ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/lib/qt4 /usr/local/lib/qt4 /usr/X11R6/lib/qt4" + ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/build/qt4/lib /opt/qt4/lib" + + ss_qt_libs_to_find="libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.dylib" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.dylib" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.dylib" + ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.a" + + AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT4_LIBDIR) + + SS_QT3_LIBDIR="$SS_QT4_LIBDIR" + SS_QTLIB_NAME="tqt" + AC_MSG_RESULT([TQt4 detected--Qt4 found in $SS_QT3_LIBDIR]) + +dnl AC_MSG_RESULT([FAILED]) +dnl AC_SS_SET_REDINK +dnl echo "################################################################################" +dnl echo "### CONFIGURE ERROR:" +dnl echo "### Can not find the qt 3.x library file." +dnl echo "### Make sure that qt is correctly installed on your system," +dnl echo "### and the qt version is the one requested by this version of kvirc." +dnl echo "### (Usually a greater version is OK too)" +dnl echo "### Try to run configure again, this time passing the --with-qt-library-dir" +dnl echo "### option (see ./configure --help)." +dnl echo "### You may also take a look at the config.log file in this directory," +dnl echo "### that will tell you which check has failed and maybe more about the reason" +dnl echo "### of the failure." +dnl echo "### If you're feeling that this may be a bug in this configure script" +dnl echo "### and want to report this to me , please include your configure script," +dnl echo "### the config.log file as well as the complete configure output." +dnl echo "################################################################################" +dnl AC_SS_SET_NORMALINK +dnl AC_MSG_ERROR([This was a fatal one...aborting]) else - AC_MSG_RESULT([found in $SS_QT3_LIBDIR]) + AC_MSG_RESULT([TQt3 found in $SS_QT3_LIBDIR]) fi else AC_MSG_RESULT([using user supplied path for the Qt library $SS_QT3_LIBDIR]) @@ -1781,7 +1823,7 @@ AC_DEFUN([AC_SS_FIND_QT3_MOC], AC_ARG_WITH(qt-moc,[ --with-qt-moc filename of the Qt 3.x meta object compiler ],SS_QT3_MOC="$withval",SS_QT3_MOC="NOTGIVEN") if test "$SS_QT3_MOC" = "NOTGIVEN"; then - AC_MSG_CHECKING([for the Qt 3.x moc]) + AC_MSG_CHECKING([for the Qt 3.x tmoc]) unset SS_QT3_MOC ss_moc_test_dirs="$QTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin" @@ -1789,7 +1831,7 @@ AC_DEFUN([AC_SS_FIND_QT3_MOC], ss_moc_test_dirs="$SS_QT3_GENERAL_DIR/bin $ss_moc_test_dirs" fi - AC_SS_FIND_FILE_PATH(moc,$ss_moc_test_dirs,SS_QT3_MOC) + AC_SS_FIND_FILE_PATH(tmoc,$ss_moc_test_dirs,SS_QT3_MOC) if test "$SS_QT3_MOC" = "FAILED"; then AC_MSG_RESULT([FAILED]) @@ -1811,7 +1853,7 @@ AC_DEFUN([AC_SS_FIND_QT3_MOC], AC_SS_SET_NORMALINK AC_MSG_ERROR([This was a fatal one...aborting]) else - SS_QT3_MOC="$SS_QT3_MOC/moc" + SS_QT3_MOC="$SS_QT3_MOC/tmoc" AC_MSG_RESULT([found as $SS_QT3_MOC]) fi else @@ -1910,7 +1952,7 @@ AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3], CPPFLAGS="" fi CPPFLAGS="$CPPFLAGS -I$SS_QT3_INCDIR" - CXXFLAGS="-O2 -Wall $CXXFLAGS" + CXXFLAGS="-O2 -Wall -include tqt.h $CXXFLAGS" if test -n "$SS_X_LIBDIR"; then LIBS="-L$SS_X_LIBDIR" else @@ -1925,10 +1967,7 @@ AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3], fi LDFLAGS="-s $LDFLAGS" AC_TRY_LINK([ - #include - #if (QT_VERSION < 221) - #error "Bad qt version: too old" - #endif + #include ],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE") if test "$SS_QTX_LINKED_OK" = "FALSE"; then AC_MSG_RESULT([FAILED]); -- cgit v1.2.1