autoconf: remove support for compiling against Qt4

Most of the changes consist in assuming that USE_QT5=yes.

Update INSTALL and README accordingly.
This commit is contained in:
Jean-Marc Lasgouttes 2022-11-19 19:28:07 +01:00
parent db70aec262
commit 4310430a38
6 changed files with 31 additions and 88 deletions

15
INSTALL
View File

@ -52,18 +52,17 @@ You will also probably need GNU m4 (perhaps installed as gm4).
Requirements Requirements
------------ ------------
First of all, you will need a C++11 standard conforming compiler, like gcc (at First of all, you will need a C++11 standard conforming compiler, like g++ (at
least 4.9) or clang. least 4.9, to have proper srd::regex) or clang++.
LyX makes great use of the C++ Standard Template Library (STL). LyX makes great use of the C++ Standard Template Library (STL).
This means that gcc users will have to install the relevant libstdc++ This means that gcc users will have to install the relevant libstdc++
library to be able to compile this version of LyX. library to be able to compile this version of LyX.
For full LyX usability we suggest to use Qt 5.6 and higher, or at the For full LyX usability we suggest to use Qt 5.6 and higher, or at the
very least Qt 5.4. For compilation you need to compile against at least very least Qt 5.4. It is also possible to compile against Qt 6.The
Qt 4.8 which has been widely tested, and for Windows we advise at least only special point to make is that you must ensure that both LyX and
Qt 4.8.4. The only special point to make is that you must ensure that the Qt libraries are compiled with the same C++ compiler.
both LyX and the Qt libraries are compiled with the same C++ compiler.
To build LyX with spell checking capabilities included you have to To build LyX with spell checking capabilities included you have to
install at least one of the development packages of the spell checker install at least one of the development packages of the spell checker
@ -124,8 +123,8 @@ flags:
The `gprof' build type compiles and links with -pg option with gcc. The `gprof' build type compiles and links with -pg option with gcc.
o --disable-qt5 that forces configuration with Qt 4.x when Qt 5.x is o --enable-qt6 that checks configuration with Qt 6.x, and then Qt
also available. By default Qt5 is tried first, and then Qt4. 5.x. By default, only Qt5 is tried.
o --with-extra-lib=DIRECTORY that specifies the path where LyX will o --with-extra-lib=DIRECTORY that specifies the path where LyX will
find extra libraries (like Qt) it needs. Defaults to NONE find extra libraries (like Qt) it needs. Defaults to NONE

3
README
View File

@ -91,8 +91,7 @@ What do I need to compile LyX from the source distribution?
need at least gcc 4.9. need at least gcc 4.9.
* The Qt library, at least version 5.2 (5.6 recommended). It is * The Qt library, at least version 5.2 (5.6 recommended). It is
still possible to compile with Qt 4.8, but this is not also possible to compile with Qt 6.x.
recommended.
Read the file "INSTALL" for more information on compiling. Read the file "INSTALL" for more information on compiling.

View File

@ -1,10 +1,7 @@
Things left to do after killing Qt4 (obtained by grepping for Qt4 and 'Qt 4'): Things left to do after killing Qt4 (obtained by grepping for Qt4 and 'Qt 4'):
* look at the FIXME KILLQT4 comments in src/ and resolve them * look at the FIXME KILLQT4 comments in src/ and resolve them
* update README
* update INSTALL
* update INSTALL.cmake * update INSTALL.cmake
* update INSTALL.MacOSX * update INSTALL.MacOSX
* update autoconf
* update cmake * update cmake
* check whether development/autotests/keytest.py really needs QT4 * check whether development/autotests/keytest.py really needs QT4
investigate references to Qt4 in keytest investigate references to Qt4 in keytest

View File

@ -74,18 +74,6 @@ AC_MSG_RESULT([$USE_QT6])
AC_SUBST([USE_QT6]) AC_SUBST([USE_QT6])
]) ])
dnl dnl
AC_DEFUN([LYX_CHECK_QT5],[
AC_MSG_CHECKING([whether Qt5 is disabled])
AC_ARG_ENABLE([qt5],
[AS_HELP_STRING([--disable-qt5],[do not use Qt5 for building])],
USE_QT5=$enableval, USE_QT5=yes)
if test x$USE_QT5 != xno ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
AC_SUBST([USE_QT5])
])
dnl Usage: LYX_WARNING(message) Displays the warning "message" and sets the dnl Usage: LYX_WARNING(message) Displays the warning "message" and sets the
@ -381,9 +369,8 @@ if test x$GXX = xyes; then
AM_CXXFLAGS="$AM_CXXFLAGS -fno-omit-frame-pointer" AM_CXXFLAGS="$AM_CXXFLAGS -fno-omit-frame-pointer"
fi fi
if test x$USE_QT5 = xyes -o x$USE_QT6 = xyes; then
AS_CASE([$host], [*mingw*|*cygwin*], [], [AM_CXXFLAGS="-fPIC $AM_CXXFLAGS"]) AS_CASE([$host], [*mingw*|*cygwin*], [], [AM_CXXFLAGS="-fPIC $AM_CXXFLAGS"])
fi
dnl Warnings are for preprocessor too dnl Warnings are for preprocessor too
if test x$enable_warnings = xyes ; then if test x$enable_warnings = xyes ; then
AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra" AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra"

View File

@ -29,7 +29,7 @@ AC_DEFUN([QT_CHECK_COMPILE],
if test $USE_QT6 = "yes" ; then if test $USE_QT6 = "yes" ; then
qt_corelibs="-lQt6Core -lQt6Core5Compat" qt_corelibs="-lQt6Core -lQt6Core5Compat"
qt_guilibs="-lQt6Core -lQt6Core5Compat -lQt6Concurrent -lQt6Gui -lQt6Svg -lQt6Widgets" qt_guilibs="-lQt6Core -lQt6Core5Compat -lQt6Concurrent -lQt6Gui -lQt6Svg -lQt6Widgets"
elif test $USE_QT5 = "yes" ; then else
qt_corelibs="-lQt5Core" qt_corelibs="-lQt5Core"
qt_guilibs="-lQt5Core -lQt5Concurrent -lQt5Gui -lQt5Svg -lQt5Widgets" qt_guilibs="-lQt5Core -lQt5Concurrent -lQt5Gui -lQt5Svg -lQt5Widgets"
fi fi
@ -58,8 +58,6 @@ AC_DEFUN([QT_CHECK_COMPILE],
if test -z "$qt_cv_libname"; then if test -z "$qt_cv_libname"; then
if test x$USE_QT6 = xyes ; then if test x$USE_QT6 = xyes ; then
AC_MSG_RESULT([failed, retrying with Qt5]) AC_MSG_RESULT([failed, retrying with Qt5])
elif test x$USE_QT5 = xyes ; then
AC_MSG_RESULT([failed, retrying with Qt4])
else else
AC_MSG_RESULT([failed]) AC_MSG_RESULT([failed])
AC_MSG_ERROR([cannot compile a simple Qt executable. Check you have the right \$QTDIR.]) AC_MSG_ERROR([cannot compile a simple Qt executable. Check you have the right \$QTDIR.])
@ -73,11 +71,9 @@ AC_DEFUN([QT_CHECK_COMPILE],
AC_DEFUN([QT_FIND_TOOL], AC_DEFUN([QT_FIND_TOOL],
[ [
$1= $1=
qt_major=4 qt_major=5
if test "x$USE_QT6" != "xno" ; then if test "x$USE_QT6" != "xno" ; then
qt_major=6 qt_major=6
elif test "x$USE_QT5" != "xno" ; then
qt_major=5
fi fi
qt_ext="qt$qt_major" qt_ext="qt$qt_major"
@ -191,23 +187,7 @@ AC_DEFUN([QT_DO_IT_ALL],
dnl Try again with Qt5 and then Qt4 if configuring for Qt6/5 fails dnl Try again with Qt5 and then Qt4 if configuring for Qt6/5 fails
if test x$USE_QT6 = xyes ; then if test x$USE_QT6 = xyes ; then
USE_QT6=no USE_QT6=no
USE_QT5=yes
AC_SUBST([USE_QT6]) AC_SUBST([USE_QT6])
AC_SUBST([USE_QT5])
if test -n "$PKG_CONFIG" ; then
QT_DO_PKG_CONFIG
fi
if test "$pkg_failed" != "no" ; then
QT_DO_MANUAL_CONFIG
fi
if test -z "$QT_LIB"; then
AC_MSG_ERROR([cannot find qt libraries.])
fi
elif test x$USE_QT5 = xyes ; then
USE_QT6=no
USE_QT5=no
AC_SUBST([USE_QT6])
AC_SUBST([USE_QT5])
if test -n "$PKG_CONFIG" ; then if test -n "$PKG_CONFIG" ; then
QT_DO_PKG_CONFIG QT_DO_PKG_CONFIG
fi fi
@ -246,25 +226,13 @@ AC_DEFUN([QT_DO_IT_ALL],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
AC_DEFINE(QPA_XCB, 1, [Define if Qt uses the X Window System])], AC_DEFINE(QPA_XCB, 1, [Define if Qt uses the X Window System])],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])
elif test x$USE_QT5 = xyes ; then else
AC_EGREP_CPP(xcb, AC_EGREP_CPP(xcb,
[#include <$lyx_qt5_config> [#include <$lyx_qt5_config>
QT_QPA_DEFAULT_PLATFORM_NAME], QT_QPA_DEFAULT_PLATFORM_NAME],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
AC_DEFINE(QPA_XCB, 1, [Define if Qt uses the X Window System])], AC_DEFINE(QPA_XCB, 1, [Define if Qt uses the X Window System])],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])
else
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
[#include <qglobal.h>],
[#ifndef Q_WS_X11],
[#error Fail],
[#endif]])],
qt_use_x11=yes,
qt_use_x11=no)
AC_MSG_RESULT($qt_use_x11)
if test "x$qt_use_x11" = "xyes"; then
QT_LIB="$QT_LIB -lX11"
fi
fi fi
CPPFLAGS=$save_CPPFLAGS CPPFLAGS=$save_CPPFLAGS
@ -287,9 +255,6 @@ AC_DEFUN([QT_DO_PKG_CONFIG],
PKG_CONFIG_PATH=$qt_cv_dir/lib:$qt_cv_dir/lib/pkgconfig:$PKG_CONFIG_PATH PKG_CONFIG_PATH=$qt_cv_dir/lib:$qt_cv_dir/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH export PKG_CONFIG_PATH
fi fi
qt_corelibs="QtCore"
qt_guilibs="QtCore QtGui QtSvg"
if test "x$USE_QT5" != "xno" ; then
qt_corelibs="Qt5Core" qt_corelibs="Qt5Core"
qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Svg Qt5Widgets" qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Svg Qt5Widgets"
lyx_use_x11extras=false lyx_use_x11extras=false
@ -309,7 +274,6 @@ AC_DEFUN([QT_DO_PKG_CONFIG],
if $lyx_use_macextras; then if $lyx_use_macextras; then
qt_guilibs="$qt_guilibs Qt5MacExtras" qt_guilibs="$qt_guilibs Qt5MacExtras"
fi fi
fi
PKG_CHECK_MODULES(QT_CORE, $qt_corelibs,,[:]) PKG_CHECK_MODULES(QT_CORE, $qt_corelibs,,[:])
if test "$pkg_failed" = "no" ; then if test "$pkg_failed" = "no" ; then
QT_CORE_INCLUDES=$QT_CORE_CFLAGS QT_CORE_INCLUDES=$QT_CORE_CFLAGS

View File

@ -14,9 +14,6 @@ AC_CONFIG_AUX_DIR(config)
LYX_CHECK_VERSION LYX_CHECK_VERSION
LYX_VERSION_SUFFIX LYX_VERSION_SUFFIX
LYX_CHECK_QT6 LYX_CHECK_QT6
if test x$USE_QT6 = xno ; then
LYX_CHECK_QT5
fi
# Check how the files should be packaged # Check how the files should be packaged
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
LYX_USE_PACKAGING LYX_USE_PACKAGING