]> git.lyx.org Git - lyx.git/commitdiff
Compile 3rdparty/hunspell in stdlib-debug mode when needed
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 29 Mar 2018 10:05:50 +0000 (12:05 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 29 Mar 2018 10:08:48 +0000 (12:08 +0200)
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.

3rdparty/hunspell/Makefile.am
config/lyxinclude.m4

index 7e0429d014c8a91ef163df40075f9ad74c92e164..fe0502dd210a8576559739bacdd985b90a7a176a 100644 (file)
@@ -16,7 +16,7 @@ EXTRA_DIST = \
        1.6.2/src/hunspell/hunvisapi.h.in \
        1.6.2/src/hunspell/utf_info.cxx
 
-AM_CPPFLAGS += -DHUNSPELL_STATIC
+AM_CPPFLAGS += -DHUNSPELL_STATIC @STDLIB_DEBUG@
 
 liblyxhunspell_a_SOURCES = \
        1.6.2/src/hunspell/affentry.cxx \
index ead704b1665f17da4f7a3384aa3cb8bae184188c..2c1a9af12a8e9285424e9a13011612dd6b4c5197 100644 (file)
@@ -420,6 +420,7 @@ if test x$GXX = xyes; then
         lyx_flags="$lyx_flags stdlib-debug"
        AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode])
        AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode])
+       AC_SUBST(STDLIB_DEBUG, "-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
         ;;
     esac
   fi