Commit Graph

215 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
314a121c9e Autotools: use -Wno-deprecated-declarations also with --disable-warnings
-Wno-deprecated-declarations is needed to avoid warnings about auto_ptr being obsolete.

The old code meant that the warnings would be suppressed for development builds, but active for release builds. The new code avoids that.
2015-12-11 10:31:46 +01:00
Jean-Marc Lasgouttes
26b3674240 Fix syntax error whe testing old compilers 2015-12-07 22:51:36 +01:00
Jean-Marc Lasgouttes
a0b9b9b678 Disable warning for deprecated functions in autoconf builds
This gets rid in particular of warnings on auto_ptr. This flag should be removed when 2.3 development start and we switch to unique_ptr.
2015-11-02 16:14:43 +01:00
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 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
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
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
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
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
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
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
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
Lars Gullik Bjønnes
393ade85ec config/lyxinclude.m4: add support for --enable-cxx11
Using --enable-cxx11 turns on C++11 mode in gcc.
2012-10-24 23:46:48 +02:00
Kornel Benko
20359572ed Patch from Benjamin Piwowarski
Just some comments on the patch:

- The executable name has to match the information in Info.plist (development/MacOSX/Info.plist.in and CMakeLists.txt).  The autoconf config/lyxinclude.m4 file has been modified to make it work with autotools.

- The process to build OS X bundle is to first add all the files to be included to the bundle when calling add_executable (src/CMakeLists.txt) and then by calling setting the source file property of each of these files (development/cmake/Install.cmake, l.14) so that the files are properly located into the bundle. This is also why Install.cmake has to be included two times in src/CMakeLists.txt (once to build the list of files, once to set the location of the list of files).

- in CMakeLists.txt there is a line
install(CODE "set(BU_CHMOD_BUNDLE_ITEMS 1)")
What it does is to fix the owner permissions within the bundle - this is necessary because some libraries are copied within the bundle and might be owned by root

- An empty qt.conf is included in the bundle so that QT does not try to link to other QT libraries (which will not be included in the bundle)

- In development/cmake/Install.cmake, some OS X specific files (*.sdef, qt.conf, *.icns) have to be included in the bundle

Benjamin
2012-10-13 09:53:20 +02:00
Jean-Marc Lasgouttes
51cc826961 Fix detection of system boost
Using LDFLAGS is not a good idea since it is not at the end of the link command. LIBS is better.

Some additional cleanup.
2012-10-08 10:58:45 +02:00
Jean-Marc Lasgouttes
4471e65fa1 Handle version numbers like 2.0.5dev in LYX_CHECK_VERSION 2012-07-04 12:18:15 +02:00
Stephan Witt
a86893a84c #7927 apply patch from mft to support posix packageing on Mac for the Gentoo prefix project
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40573 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-05 19:50:18 +00:00
Jean-Marc Lasgouttes
2bf021ee73 Improve support for distributing desktop files and icons
* add proper INSTALL_POSIX conditional for makefiles
* move all the code to Makefile.am
* rename lyx.desktop to lyx.desptop.in and add proper tags to allow handling of program_suffix.
* add code to install desktop entry and icons under the proper name.

I did not touch scons and cmake, I hope it was not necessary.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40531 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-20 13:11:03 +00:00
Julien Rioux
e8daa48bc1 Provide our own patched AM_PYTHON_CHECK_VERSION that requires python <3.0
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39890 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-19 20:50:58 +00:00
Richard Heck
cf4ddb2ed5 Patch from Raphael Kubo de Costa to fix build on FreeBSD.
http://marc.info/?l=lyx-devel&m=131586604331711&w=2

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39768 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-26 15:51:28 +00:00
Georg Baum
f792fe8037 fix bug #7288: add configure option for external mythes library
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37585 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-10 20:31:07 +00:00
Jean-Marc Lasgouttes
0299c0be49 fix --disable-debug in configure; more cleanups to build_type handling
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37386 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-31 10:19:03 +00:00
Jean-Marc Lasgouttes
98b48a4969 Add and document build types profinling and gprof. Some clean up of build_type code in configure
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37323 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-25 13:49:49 +00:00
Jean-Marc Lasgouttes
3b316bc83f better fix to #7239. Actually the whole switch and kaboodle (see r37229) is needed (otherwise sweave is broken)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37322 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-25 11:22:47 +00:00
Jean-Marc Lasgouttes
eb18b4e835 Rename --enable-profiling to --enable-gprof to pave the way for a configure option for normal profiling
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37245 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-18 09:57:03 +00:00