- if test x$lyx_cv_with_included_boost != xyes ; then
- AC_CHECK_LIB(boost_signals, main, [lyx_boost_underscore=yes], [], [-lm])
- AC_CHECK_LIB(boost_signals-mt, main, [lyx_boost_underscore_mt=yes], [], [-lm $LIBTHREAD])
- if test x$lyx_boost_underscore_mt = xyes ; then
- BOOST_MT="-mt"
- else
- BOOST_MT=""
- if test x$lyx_boost_plain != xyes -a x$lyx_boost_underscore != xyes ; then
- LYX_ERROR([No suitable boost library found (do not use --without-included-boost)])
- fi
+ if test x$lyx_cv_with_included_boost = xyes ; then
+ BOOST_INCLUDES='-I$(top_srcdir)/boost'
+ BOOST_LIBS='$(top_builddir)/boost/liblyxboost.a'
+ else
+ AC_LANG_PUSH(C++)
+ save_LIBS=$LIBS
+
+ AC_MSG_CHECKING([for multithreaded boost libraries])
+ LIBS="$save_LIBS -lboost_signals-mt -lm $LIBTHREAD"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <boost/signal.hpp>],
+ [boost::signal<void ()> s;])],
+ [AC_MSG_RESULT([yes])
+ BOOST_MT="-mt"],
+ [AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for plain boost libraries])
+ LIBS="$save_LIBS -lboost_signals -lm"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <boost/signal.hpp>],
+ [boost::signal<void ()> s;])],
+ [AC_MSG_RESULT([yes])
+ BOOST_MT=""],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot find suitable boost library (do not use --without-included-boost)])
+ ])
+ ])
+ LIBS=$save_LIBS
+ AC_LANG_POP(C++)
+ BOOST_INCLUDES=
+ BOOST_LIBS="-lboost_regex${BOOST_MT} -lboost_signals${BOOST_MT}"
+ fi
+ AC_SUBST(BOOST_INCLUDES)
+ AC_SUBST(BOOST_LIBS)
+])
+
+
+dnl Usage: LYX_CHECK_CALLSTACK_PRINTING: define LYX_CALLSTACK_PRINTING if the
+dnl necessary APIs are available to print callstacks.
+AC_DEFUN([LYX_CHECK_CALLSTACK_PRINTING],
+[AC_CACHE_CHECK([whether printing callstack is possible],
+ [lyx_cv_callstack_printing],
+[AC_TRY_COMPILE([
+#include <execinfo.h>
+#include <cxxabi.h>
+], [
+ void* array[200];
+ size_t size = backtrace(array, 200);
+ backtrace_symbols(array, size);
+ int status = 0;
+ abi::__cxa_demangle("abcd", 0, 0, &status);
+],
+[lyx_cv_callstack_printing=yes], [lyx_cv_callstack_printing=no])])
+if test x"$lyx_cv_callstack_printing" = xyes; then
+ AC_DEFINE([LYX_CALLSTACK_PRINTING], 1,
+ [Define if callstack can be printed])
+fi
+])
+
+
+dnl Usage: LYX_USE_INCLUDED_MYTHES : select if the included MyThes should
+dnl be used.
+AC_DEFUN([LYX_USE_INCLUDED_MYTHES],[
+ AC_MSG_CHECKING([whether to use included MyThes library])
+ AC_ARG_WITH(included-mythes,
+ [AC_HELP_STRING([--without-included-mythes], [do not use the MyThes lib supplied with LyX, try to find one in the system directories - compilation will abort if nothing suitable is found])],
+ [lyx_cv_with_included_mythes=$withval],
+ [lyx_cv_with_included_mythes=yes])
+ AM_CONDITIONAL(USE_INCLUDED_MYTHES, test x$lyx_cv_with_included_mythes = xyes)
+ AC_MSG_RESULT([$lyx_cv_with_included_mythes])
+ if test x$lyx_cv_with_included_mythes != xyes ; then
+ AC_LANG_PUSH(C++)
+ AC_CHECK_HEADER(mythes.hxx,[ac_cv_header_mythes_h=yes lyx_cv_mythes_h_location="<mythes.hxx>"])
+ if test x$ac_cv_header_mythes_h != xyes; then
+ AC_CHECK_HEADER(mythes/mythes.hxx,[ac_cv_header_mythes_h=yes lyx_cv_mythes_h_location="<mythes/mythes.hxx>"])
+ fi
+ AC_CHECK_LIB(mythes, main, [MYTHES_LIBS="-lmythes" lyx_mythes=yes], [lyx_mythes=no], [-lm])
+ if test x$lyx_mythes != xyes; then
+ AC_CHECK_LIB(mythes-1.2, main, [MYTHES_LIBS="-lmythes-1.2" lyx_mythes=yes], [lyx_mythes=no], [-lm])