Compile 3rdparty/hunspell in stdlib-debug mode when needed

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.
This commit is contained in:
Jean-Marc Lasgouttes 2018-03-29 12:05:50 +02:00
parent 1cbe568d61
commit d9e0a842cf
2 changed files with 2 additions and 1 deletions

View 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 \

View 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