Added preliminary Qt4 stuff that will hopefully be used in the future

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kde-common@1150482 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
master
tpearson 15 years ago
parent e2d8417299
commit 614d11e5a1

@ -331,6 +331,18 @@ AC_DEFUN([AC_PATH_QT_MOC_UIC],
UIC="$UIC -nounload"
fi
fi
if test $kde_qtver = 4; then
KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
if test x$ac_uic_supports_libpath = xyes; then
UIC="$UIC -L \$(kde_widgetdir)"
fi
if test x$ac_uic_supports_nounload = xyes; then
UIC="$UIC -nounload"
fi
fi
fi
else
UIC="echo uic not available: "
@ -343,6 +355,9 @@ AC_DEFUN([AC_PATH_QT_MOC_UIC],
if test $kde_qtver = 3; then
UIC_TR="tr2i18n"
fi
if test $kde_qtver = 4; then
UIC_TR="tr2i18n"
fi
AC_SUBST(UIC_TR)
])
@ -599,6 +614,10 @@ AC_DEFUN([KDE_SUBST_PROGRAMS],
fi
fi
fi
if test "$kde_qtver" = "4"; then
kde32ornewer=
kde33ornewer=
fi
fi
if test -n "$kde32ornewer"; then
@ -1092,9 +1111,22 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
EOF
if test "$kde_qtver" = "4"; then
cat >> conftest.$ac_ext <<EOF
#include <Qt/qglobal.h>
#include <Qt/qapplication.h>
EOF
fi
if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF
#include <qglobal.h>
#include <qapplication.h>
EOF
fi
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
#include <qevent.h>
@ -1119,6 +1151,13 @@ cat >> conftest.$ac_ext <<EOF
EOF
fi
if test "$kde_qtver" = "4"; then
cat >> conftest.$ac_ext <<EOF
#include <Qt/qcursor.h>
#include <Qt/qstylefactory.h>
EOF
fi
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
cat >> conftest.$ac_ext <<EOF
#error 1
@ -1144,6 +1183,12 @@ cat >> conftest.$ac_ext <<EOF
QCursor c(Qt::WhatsThisCursor);
EOF
fi
if test "$kde_qtver" = "4"; then
cat >> conftest.$ac_ext <<EOF
(void)QStyleFactory::create(QString::null);
QCursor c(Qt::WhatsThisCursor);
EOF
fi
cat >> conftest.$ac_ext <<EOF
return 0;
}
@ -1191,6 +1236,21 @@ if test -z "$2"; then
kde_qt_minversion=">= Qt 3.0 and < 4.0"
fi
fi
if test "$kde_qtver" = "4"; then
if test $kde_qtsubver -gt 0; then
if test $kde_qtsubver -gt 1; then
if test $kde_qtsubver -gt 2; then
kde_qt_minversion=">= Qt 4.3 and < 5.0"
else
kde_qt_minversion=">= Qt 4.2 and < 5.0"
fi
else
kde_qt_minversion=">= Qt 4.1 and < 5.0"
fi
else
kde_qt_minversion=">= Qt 4.0 and < 5.0"
fi
fi
if test "$kde_qtver" = "1"; then
kde_qt_minversion=">= 1.42 and < 2.0"
fi
@ -1199,6 +1259,15 @@ else
fi
if test -z "$3"; then
if test $kde_qtver = 4; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x04@VER@00 && QT_VERSION < 0x050000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else
kde_qt_verstring="QT_VERSION >= 400 && QT_VERSION < 0x050000"
fi
fi
if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
@ -1357,20 +1426,31 @@ dnl ------------------------------------------------------------------------
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
dnl ------------------------------------------------------------------------
if test -z "$LIBQT_GLOB"; then
if test "x$kde_use_qt_emb" = "xyes"; then
LIBQT_GLOB="libqte.*"
else
LIBQT_GLOB="libqt.*"
if test "$kde_qtver" = "4"; then
LIBQT_GLOB="libQtCore.*"
fi
if test "$kde_qtver" = "3"; then
if test "x$kde_use_qt_emb" = "xyes"; then
LIBQT_GLOB="libqte.*"
else
LIBQT_GLOB="libqt.*"
fi
fi
fi
dnl ------------------------------------------------------------
dnl If we got --enable-embedded then adjust the Qt library name.
dnl Also Qt4 uses a different library name
dnl ------------------------------------------------------------
if test "x$kde_use_qt_emb" = "xyes"; then
qtlib="qte"
else
qtlib="qt"
if test "$kde_qtver" = "4"; then
qtlib="QtCore -lQtGui"
fi
if test "$kde_qtver" = "3"; then
if test "x$kde_use_qt_emb" = "xyes"; then
qtlib="qte"
else
qtlib="qt"
fi
fi
kde_int_qt="-l$qtlib"
@ -1397,7 +1477,9 @@ dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then
LIBQT="-l$qtlib-mt"
kde_int_qt="-l$qtlib-mt"
LIBQT_GLOB="lib$qtlib-mt.*"
if test "$kde_qtver" = "3"; then
LIBQT_GLOB="lib$qtlib-mt.*"
fi
USING_QT_MT="using -mt"
else
LIBQT="-l$qtlib"
@ -1415,6 +1497,11 @@ if test $kde_qtver = 3; then
LIBQT="$LIBQT $LIBDL"
fi
if test $kde_qtver = 4; then
AC_REQUIRE([KDE_CHECK_LIBDL])
LIBQT="$LIBQT $LIBDL"
fi
AC_MSG_CHECKING([for Qt])
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
@ -1465,7 +1552,11 @@ if test ! "$ac_qt_includes" = "NO"; then
fi
if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h
if test "$kde_qtver" = "4"; then
kde_qt_header="Qt/qstyle.h"
else
kde_qt_header=qstyle.h
fi
else
kde_qt_header=qglobal.h
fi
@ -1598,6 +1689,8 @@ AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_LDFLAGS)
AC_PATH_QT_MOC_UIC
KDE_CHECK_TQT
KDE_CHECK_QT_JPEG
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
@ -2057,6 +2150,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
if test "$kde_qtver" = "3"; then
AC_TRY_LINK([
#include <qdom.h>
],
@ -2066,11 +2160,24 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
kde_cv_have_kdeqtaddon=yes,
kde_cv_have_kdeqtaddon=no
)
fi
if test "$kde_qtver" = "4"; then
AC_TRY_LINK([
#include <Qt/qdom.h>
],
[
QDomDocument doc;
],
kde_cv_have_kdeqtaddon=yes,
kde_cv_have_kdeqtaddon=no
)
LDFLAGS=$kde_ldflags_safe
LIBS=$kde_libs_safe
CXXFLAGS=$kde_cxxflags_safe
])
fi
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
@ -2086,7 +2193,33 @@ AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
AC_REQUIRE([KDE_CHECK_LIBDL])
AC_REQUIRE([K_PATH_X])
if test $kde_qtver = 3; then
if test $kde_qtver = 4; then
case $host in
*cygwin*) lib_kded="-lkdeinit_kded" ;;
*) lib_kded="" ;;
esac
AC_SUBST(LIB_KDED, $lib_kded)
AC_SUBST(LIB_KDECORE, "-lkdecore")
AC_SUBST(LIB_KDEUI, "-lkdeui")
AC_SUBST(LIB_KIO, "-lkio")
AC_SUBST(LIB_KJS, "-lkjs")
AC_SUBST(LIB_SMB, "-lsmb")
AC_SUBST(LIB_KAB, "-lkab")
AC_SUBST(LIB_KABC, "-lkabc")
AC_SUBST(LIB_KHTML, "-lkhtml")
AC_SUBST(LIB_KSPELL, "-lkspell")
AC_SUBST(LIB_KPARTS, "-lkparts")
AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
AC_SUBST(LIB_KUTILS, "-lkutils")
AC_SUBST(LIB_KDEPIM, "-lkdepim")
AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
AC_SUBST(LIB_KDNSSD, "-lkdnssd")
AC_SUBST(LIB_KUNITTEST, "-lkunittest")
# these are for backward compatibility
AC_SUBST(LIB_KSYCOCA, "-lkio")
AC_SUBST(LIB_KFILE, "-lkio")
elif test $kde_qtver = 3; then
case $host in
*cygwin*) lib_kded="-lkdeinit_kded" ;;
*) lib_kded="" ;;
@ -2605,6 +2738,43 @@ AH_VERBATIM(_AC_CHECK_JPEG,
])
])
AC_DEFUN([KDE_CHECK_TQT],
[
AC_MSG_CHECKING([if TQt is available])
AC_CACHE_VAL(kde_cv_tqt,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_LIBS="$LIBS"
LIBS="$all_libraries $USER_LDFLAGS $LIBQT -ltqt"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
if test "$kde_qtver" -gt "2"; then
AC_TRY_LINK(
[#include <tqtimer.h>],
[
QTimer *test_timer(0);
test_timer->start(1000);],
eval "kde_cv_tqt=no",
eval "kde_cv_tqt=yes")
fi
LIBS="$ac_save_LIBS"
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if eval "test ! \"`echo $kde_cv_tqt`\" = no"; then
AC_MSG_RESULT(no)
dnl AC_MSG_ERROR([You are attempting to compile Trinity without the Trinity Qt Interface installed. Please install libtqtinterface-dev and try again!])
else
AC_MSG_RESULT(yes)
LIBTQT_LDFLAGS="-ltqt"
all_libraries="$all_libraries $LIBTQT_LDFLAGS"
QT_LDFLAGS="$QT_LDFLAGS $LIBTQT_LDFLAGS"
fi
])
AC_DEFUN([KDE_CHECK_QT_JPEG],
[
if test -n "$LIBJPEG"; then
@ -2618,6 +2788,17 @@ LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
if test "$kde_qtver" = "4"; then
AC_TRY_LINK(
[#include <Qt/qapplication.h>],
[
int argc;
char** argv;
QApplication app(argc, argv);],
eval "kde_cv_qt_jpeg=no",
eval "kde_cv_qt_jpeg=yes")
fi
if test "$kde_qtver" = "3"; then
AC_TRY_LINK(
[#include <qapplication.h>],
[
@ -2626,6 +2807,7 @@ AC_TRY_LINK(
QApplication app(argc, argv);],
eval "kde_cv_qt_jpeg=no",
eval "kde_cv_qt_jpeg=yes")
fi
LIBS="$ac_save_LIBS"
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
@ -3462,6 +3644,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
safe_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $all_includes"
if test "$kde_qtver" = "3"; then
AC_TRY_COMPILE(
[
#include <qglobal.h>
@ -3471,6 +3654,19 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
#endif
], [/* elvis is alive */],
kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
fi
if test "$kde_qtver" = "4"; then
AC_TRY_COMPILE(
[
#include <Qt/qglobal.h>
#if Q_EXPORT - 0 != 0
/* if this compiles, then Q_EXPORT is undefined */
/* if Q_EXPORT is nonempty, this will break compilation */
#endif
], [/* elvis is alive */],
kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
fi
CXXFLAGS=$safe_CXXFLAGS
AC_LANG_RESTORE
@ -4712,6 +4908,8 @@ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_LIBS="$LIBS"
ac_save_CXXFLAGS="$CXXFLAGS"
if test "$kde_qtver" = "3"; then
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl
@ -4727,6 +4925,26 @@ int main() {
ac_cv_lib_qimgio=yes,
ac_cv_lib_qimgio=no,
ac_cv_lib_qimgio=no)
fi
if test "$kde_qtver" = "4"; then
LIBS="$all_libraries -lpng -lz $LIBJPEG $LIBQT"
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl
[
#include <tqimageio.h>
#include <tqstring.h>
int main() {
QString t = "hallo";
t.fill('t');
qInitImageIO();
}
],
ac_cv_lib_qimgio=yes,
ac_cv_lib_qimgio=no,
ac_cv_lib_qimgio=no)
fi
LIBS="$ac_save_LIBS"
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE

Loading…
Cancel
Save