Commit Graph

462 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
e1938aa240 Fix some compilation problems in C++11 mode
Only enable std::regex when the header <regex> is present (fix Mac OS X issue).

Remove support for concept checks. The page
  https://gcc.gnu.org/onlinedocs/libstdc++/manual/concept_checking.html
says about concept checking:

  Please note that the checks are based on the requirements in the
  original C++ standard, many of which were relaxed in the C++11
  standard and so valid C++11 code may be incorrectly rejected by the
  concept checks. Additionally, some correct C++03 code might be
  rejected by the concept checks, for example template argument types
  may need to be complete when used in a template definition, rather
  than at the point of instantiation. There are no plans to address
  these shortcomings.

Therefore it seems reasonable to remove our support for this.
2015-09-25 14:12:30 +02:00
Jean-Marc Lasgouttes
b7909e7e6c Remove support for precompiled headers for autotools
This was turned off by default for a long time, and it does not seem
to have any use these days.
2015-09-25 12:05:40 +02:00
Jean-Marc Lasgouttes
7f4101a556 Change --enable-cxx11 configure option to --disable-cxx11 2015-09-25 10:47:42 +02:00
Jean-Marc Lasgouttes
d95c187b5a Give a warning when system boost and stdlib-debug are used together
In general this would lead to an immediate runtime crash because the
runtime checks of libstdc++ change the layout of some STL objects.
Therefore, this will only work when the boost libraries have been
compiled with this same flag. At this time, it is not known whether
any linux distribution contains such libraries.

Fixes bug #9736.
2015-09-22 14:38:31 +02:00
Jean-Marc
a22f7b7001 Do not use -Wfloat-conversion with recent gcc versions 2015-09-10 18:12:35 +02:00
Enrico Forestieri
864a4db26b On cygwin, use -std=gnu++11 instead of -std=c++11
This allows compiling without monkeying with compiler guards.
2015-09-09 02:34:18 +02:00
Enrico Forestieri
bde1bee24e Make it compile on cygwin in c++11 mode
When using -std=c++11, the cygwin compiler automatically defines
__STRICT_ANSI__ which is used as a guard for not declaring essential
unix standard calls such as setenv, popen, etc. As a result,
compilation stops with errors such as "xxxx has not been declared".
By undefining the guard, compilation succeeds and lyx works Ok.
2015-09-09 01:54:49 +02:00
Jean-Marc Lasgouttes
893ae612e4 Use C++11 by default when possible
Compiler that are known to support C++11 (gcc >= 4.3 and clang) are
now used in this mode by default. It is still possible to override
this choice using --(en|dis)able-cxx11.

Moreover, c++11 mode is detected from the compiler itself, not from
the use of --enable-cxx11. This allows to support compilers other
than gcc or clang.

Update INSTALL file accordingly and clean it a little bit.
2015-09-07 11:42:39 +02:00
Jean-Marc Lasgouttes
67385e69fc Improve detection of C++11 mode
This replaces commit 329eae56 with a better solution. Indeed, while
__cpluplus is useless with g++ 4.[3-6] because its value is always 1,
these compilers define __GXX_EXPERIMENTAL_CXX0X__ when "-std c++0x" is used.

Therefore the code now relies on both macros to detect C++11 mode
instead of setting it when --enable-cxx11 is used.

Also, use pure c++ mode instead of gnu++ extensions on gcc
2015-09-03 10:22:56 +02:00
Jean-Marc
e471e6cd49 Do not forget QtSvg when using pkgconfig in autoconf 2015-07-12 19:12:51 +02:00
Jean-Marc Lasgouttes
ba13a832d6 Do not require libm when searching for system boost
Doing so breaks building under Haiku, which does not have libm.

See ticket #7568 for details.
2015-06-11 18:08:19 +02:00
Jessica Hamilton
dcfb918f15 Add packaging support for Haiku
See bug #7568 for details.
2015-06-08 17:18:14 +02:00
Stephan Witt
cadc406363 #9130 Text in main work area isn't rendered with high resolution
Add Qt5Svg for pkgconfig based compile and linker flags setup.
2015-05-20 11:04:26 +02:00
Jean-Marc Lasgouttes
329eae5605 Use explicit macro to declare that we want to use C++11
This replaces tests for __cplusplus >= 201103L, which are wrong with gcc 4.6 and earlier. Indeed these versions of gcc define __cplusplus = 1.

Reference:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
2015-05-20 10:19:19 +02:00
Stephan Witt
0933df0011 Add Qt's Svg module to the list of used modules. This is required to allow the use of e.g. the QSvgRenderer class. 2015-05-19 22:46:26 +02:00
Georg Baum
7b0485dbb2 Remove gcc 3 traces
We claim that gcc 4.x is needed in INSTALL, so it does not make sense to keep
this old stuff. Instead, I made configure output an error if gcc is too old.
2015-05-10 10:01:33 +02:00
Georg Baum
51cc8aa9f6 Fix build with GNU libstdc++ C++11 ABI
The GNU libstdc++ that ships witch gcc 5 can be used with the same ABI as
older versions, or with a new ABI which is conformant to the C++11 standard.
LyX did not build if the latter was used:
https://kojipkgs.fedoraproject.org//work/tasks/1267/9651267/build.log

This is now fixed by detecting the ABI version and disabling the wrong forward
declarations. At the same time, STD_STRING_USES_COW is switched off for the
C++11 ABI version, because the std::basic_string implementation is now C++11
conformant. Since the GNU libstdc++ can also used by other compilers such as
clang, we must not test for the compiler version.
2015-05-08 21:12:42 +02:00
Jean-Marc Lasgouttes
4f3d9d0092 Autotools: configure AR program
Some distros may use target-specific prefix for ar program (like
x86_64-pc-linux-gnu-ar). Automake can handle that since version 1.12.

Since we still support automake 1.8 (not that it is really crucial,
but ubuntu 12.04 ships with automake 1.11.3), make the code
conditional.

Update a bit the gitignore files (automake creates some files in config/).

Based on a patch from Nikolay Orlyuk <virkony@gmail.com>.
2015-05-06 17:08:56 +02:00
Jean-Marc Lasgouttes
3d7ec5e25f Autotool python support: allow to set version in configure.ac. 2015-03-24 12:09:21 +01:00
Jean-Marc Lasgouttes
babe5e05f8 Autotools: check for python >= 2.7.0 or >= 3.3.0
A new macro adapted from AM_PROG_PYTHON is defined. It does the dual version testing for python 2 and python 3. The rest of the functionnality of AM_PROG_PYTHON has been stripped off.

Once our special macro has been invoked, we use the usual AM_PROG_PYTHON.
2015-03-24 10:34:08 +01:00
Scott Kostyshak
36c3495a3a Correct the spelling of "occured" to "occurred" 2015-02-09 18:44:02 -05:00
Jean-Marc Lasgouttes
33ff0f276a More tweaks to C++ compiler detection
Now CXXFLAGS is left alone by autoconf: only the user can override it.

Properly set -g and -O options, which were overriden.

Try to put the arguments in a more reasonable ordering.
2015-01-13 15:59:30 +01:00
Jean-Marc Lasgouttes
3fca2b557b Fixup commit ff42fe
It looks like bash pattern matching does not work as I think it does. Play safe for now.
2015-01-13 12:38:55 +01:00
Jean-Marc Lasgouttes
ff42fea8ab Cleanup autoconf compiler support
Get rid of some old useless compiler checking code

Do not touch CXXFLAGS and friends, only the AM_* version

Let the gcc-related options for latest known version be the default (assume they will still be fine in future versions)

Try to take clang in account in a better way (to be continued):
 * use proper option for C++11,
 * use -Wno-deprecated-register in this case because Qt has a lot of these
 * define version as being clang for internal testing (there is no real way to get the clang version)
2015-01-13 12:06:55 +01:00
Enrico Forestieri
d4428ceb81 Adjust preprocessor guards for Qt5/X11.
This fixes the -geometry command line option and restores the
"Use icons from system's theme" checkbox in the preferences.

There is still code addressing Qt4 and xlib that has to be
audited. This code cannot be compiled with Qt5 because the
default backend is now xcb and not xlib. I have marked such
code with a "FIXME QT5" comment.
2015-01-11 19:44:35 +01:00
Georg Baum
be22665ceb Fix autotools config for gcc < 4.9
Since LYX_USE_STD_REGEX is used in Makefile.am, it must always be defined, not
only if C++11 support is enabled.
2015-01-06 19:48:27 +01:00
Jean-Marc Lasgouttes
41405babc5 Cleanup support for std::regex with autotools
Do not link against system boost regex lib or build included boost regex when not needed.
2015-01-06 18:47:00 +01:00
Enrico Forestieri
dd2a8b616e Adjust autotools default configure options for Qt5.
* Disable concept-checks unless explicitly required (errors out with Qt5).
* Add -fPIC to CPPFLAGS for elf targets (required with Qt5).
2015-01-04 18:07:11 +01:00
Enrico Forestieri
ab3259885b Fix configuring for Qt5 with autotools on non-Mac platforms. 2015-01-01 18:44:01 +01:00
Stephan Witt
0379bade17 #9323 add check for Qt5MacExtras to use it on Mac with --enable-qt5 2014-12-29 00:18:40 +01:00
Enrico Forestieri
9126a99e97 Fix bug #9217: [Qt5] QWindowsMime class not available
The support for QWindowsMime has been reintroduced in Qt 5.4.0.
The class name has been changed to QWinMime but the interface
is exactly the same.
2014-12-26 16:53:31 +01:00
Georg Baum
7796ad3a36 Improve llvm libc++ detection
The old detection did only work if CFLAGS contained -std=c++11, since ciso646
was only included for __cplusplus > 199711.
Thanks to Koernel for the cmake part.
2014-12-21 17:26:21 +01:00
Jean-Marc Lasgouttes
385f3e8abd Check for string COW by checking for library, not compiler
Note in particular that clang++ uses libstdc++ (GNU) by default, and not libc++.
Therefore, it suffers from the string COW bug too.
2014-12-19 08:54:07 +01:00
Jean-Marc Lasgouttes
dd2be1777f Detect whether the C++ compiler is clang
This does not have a real effect for now.
2014-12-17 12:11:10 +01:00
Georg Baum
83bee109db Make trivstring class ready for use
The interface is now 100% unit tested, and the typedefs depend on the new
STD_STRING_USES_COW configuration variable. The only missing bit is to detect
clang and disable STD_STRING_USES_COW for clang.
2014-12-07 13:14:17 +01:00
Jean-Marc Lasgouttes
0b09424017 Autotools: read git commit hash at compile time
Also do as cmake to avoid full recompilation when the hash changes.
2014-11-24 22:00:21 +01:00
Jean-Marc Lasgouttes
dc7ef3c81f Implement "callstack printing" checking for autotools
Contrary to cmake, we do not rely on platform/compiler check, but on the
availability of the reauired API.
2014-11-04 23:48:03 +01:00
Jean-Marc Lasgouttes
8ecb96c09a Add the git commit (if applicable) to LyX version
This only works for autotools right now, but adding that to cmake is trivial
2014-10-10 12:12:17 +02:00
Stephan Witt
327da4f275 Add QtMacExtras detection for Qt5 support 2014-08-21 18:22:43 +02:00
Enrico Forestieri
4bdeae2733 Update autotools for building with Qt5.
The option --enable-qt5 allows configuring for Qt5. The default is Qt4.
Nothing special is done with respect to Qt4, apart from pulling in the
correct libraries. Indeed, other than the core and gui libraries, now
also the concurrent and widgets libraries are needed.
2014-07-19 03:34:28 +02:00
Jean-Marc Lasgouttes
3cbd343a55 Cleanup the code for boost configuration 2014-05-05 10:11:18 +02:00
Jean-Marc Lasgouttes
5ff8a01cb6 Fix oversight in autotools packaging selection
The only consequence of this thinko is that the lyx.desktop and the svg icons were installed on Mac OS and Windows platform, whereas they are useless.
2014-04-21 11:51:59 -04:00
Jean-Marc Lasgouttes
3e073ec919 Quick workaround for detection of Qt/Mac using pkg-config 2013-07-19 16:03:54 +02:00
Jean-Marc Lasgouttes
b58b8e7c73 Fix Qt tools search when a Qt directory has been specified
When --with-qt-dir has been specified, programs like "moc" in the Qt
directory are unlikely to have a qualified name like moc-qt4.
Therefore, such qualified names are only considered when the base
version has not been found.
2013-07-13 22:44:28 +02:00
Jean-Marc Lasgouttes
aaacbe579b Update our documentation to mention git instead of svn.
Note that some mentions of svn remain in
* development/cmake/LyxPackaging.cmake
* development/LyX-Mac-binary-release.sh
* development/Win32/packaging/installer/settings.nsh
2013-05-27 18:19:59 +02:00
Jean-Marc Lasgouttes
3ef4db2ce4 Continue pre-spring cleaning of configure script
* build-type=profiling implies -fno-omit-frame-pointer in gcc. This allows sysprof to yield proper call trees
 * remove --enable-grpof option (the build type is enough)
 * remove --with-frontend option since we have only one frontend. Move stuff around and generally simplify the Qt detection code
 * do not check for bc anymore.
 * Update README.
2013-03-19 16:41:14 +01:00
Jean-Marc Lasgouttes
04a8db4af8 Get rid of LYX_ERROR in our configure file.
We use the standard AC_MSG_ERROR instead, which just stops the configure process where the problem happens.
2013-03-19 15:15:56 +01:00
Jean-Marc Lasgouttes
1d08d5232d Add a test to configure for minimal Qt version
* use AS_COMPARE_VERSION to check whether the Qt version is correct.
* upgrade minimal requirement for autoconf to version 2.60 (released in 2006!).
2013-03-19 12:59:38 +01:00
Stephan Witt
141fbb6f8c Prepare LyX code to compile and link with Qt5:
* some functionality is in new modules now
  new header locations and library names: QtConcurrent and QtWidgets
* method setResizeMode is renamed to setSectionResizeMode
* deprecated QAbstractItemModel::reset() is dropped now
* platform specific code like QApplication::syncX() is not common anymore
* QString::fromAscii() is dropped now
* some QDesktopServices methods has been moved to QStandardPaths
2013-02-03 19:26:21 +01:00
Stephan Witt
6fb0d9035c ignore auto maked script test-driver 2013-01-20 12:45:34 +01:00