This commit allows compiling LyX with Qt6 when using autotools.
For a successful compilation the following 2 conditions must be met.
1) The Qt6 qmake has to come first in PATH, so that the command
"qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
2) The --enable-qt6 switch has to be passed to the configure command.
If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
If also Qt5 is not found, configuring for Qt4 is attempted.
If --enable-qt6 is not used, then things go as usual. This means that Qt5
is tried first and then Qt4, unless --disable-qt5 is used, in which case
Qt4 is directly attempted. This means that existing scripts should
continue working unmodified.
LyX should compile with Qt6 on windows and linux, and possibly also on
mac, but I could not test that. However, it is not guaranteed that it
works as it should. In particular I am not sure that I got right the
conversion from QRegExp to QRegularExpression. For sure, the syntax
highlighting seems to not work right. Someone in the know should take
a look at that. I am able to load documents and compile them but some
thourough testing is needed. However, when compiling for Qt5 or Qt4,
I tried to make sure that the functionality is preserved.
1/ remove boost regex code from 3rdparty/boost. Only the cmake stuff remains.
2/ remove traces of BOOST_LIB since there is no need anymore to
compile boost stuff.
3/ remove traces of boost regexp in config/lyxinclude.m4 and INSTALL
4/ require gcc 4.9 as minimal version in autoconf.
Unfortunately, the net gain is only 10% of included boost size (now 21M).
Introduce new configure option --enable-cxx-mode=MODE, which allows to
force a C++ version. The default is {14,11}, which means that C++14 is
chosen if it is supported, and C++11 will be selected as a fallback.
Using --enable-cxx-mode=11 ensures that LyX compiles correctly
with an older C++11 compiler.
This is better than depending on compiler version. In particular,
Apple clang versions do not match regular clang versions.
Note that -Wno-deprecated-copy will always be used with g++, since
this compiler allows to suppress warnings it does not know about
(-Wno-zorg is valid, even though -Wzorg triggers an error).
This was already done for gcc9 and saves tons of warnings.
Note that the warning in Qt are gone with Qt5.13, so eventually we
will have to get rid of our own copy issues.
In particular, the directory frontends/qt4 is renamed to frontends/qt.
Many configurations file have to be updated. All mentions of qt4 in
the source have been audited, and changed to qt if necessary.
The only part that has not been updated is the CMake build system.
Recent gcc versions return a short version with -dumpversion, e.g. 9.
In this case, use -dumpfullversion, which gives something like 9.1.0.
This makes the gcc 9 detection work properly.
The warning about unneeded std::move can be solved by conditioning on
C++14 mode.
The warnings about deprecated copy is harder, so we disable it for
now. We will be able to fix our part, but Qt triggers it a lot too.
Python 3.x shall have priority over python 2.x. In 2.5.0dev, support
for python2 will be removed.
Now, we ignore all pythonx.y names, which are not relevant, and do not try
either the basic "python" name.
When callback printing is enabled, link lyx with -rdynamic, so that
stacks have LyX symbols available.
Add option --disable-callstack-printing to configure.
Running "size" on binary:
* with callstack printing support
text data bss dec hex filename
20891684 34680 107796 21034160 140f4b0 src/lyx
* without callstack printing support
text data bss dec hex filename
17953640 34648 107796 18096084 1141fd4 src/lyx
Until now, building with Qt5 required using --enable-qt5.
This is no more necessary. To build with Qt4 one should now
use --disable-qt5 or, equivalently, --enable-qt5=no.
A function that returns a vector<string> will lead to a crash if the
main code and the library have not been compiled with the same
stdlib-debug state. See for example:
https://stackoverflow.com/questions/4764048/stl-and-release-debug-library-mess
This is fixed by introducing a new variable STDLIB_DEBUG that contains
the flags that trigger the debug mode (autoconf only for now).
This will allow to go forward with bug #10547.
As of enchant 2.x, it is required to create a Broker instance instead
of relying on a static one provided by the library.
Add autoconf and cmake (courtesy of Kornel) tests that check whether
one can indeed instantiate a Broker object, and act on the result in a
new broker() helper function.
Fixes bug #10986.