Fix build on FreeBSD

This is a backport of a patch from Raphael Kubo de Costa
  http://marc.info/?l=lyx-devel&m=131586604331711&w=2
further updated in 51cc8269 to use LDFALGS intead of LIBS.

Some additional cleanup.
This commit is contained in:
Richard Heck 2011-09-26 15:51:28 +00:00 committed by Jean-Marc Lasgouttes
parent a834d161d2
commit 240d810835
2 changed files with 14 additions and 6 deletions

View File

@ -321,17 +321,25 @@ AC_DEFUN([LYX_USE_INCLUDED_BOOST],[
AM_CONDITIONAL(USE_INCLUDED_BOOST, test x$lyx_cv_with_included_boost = xyes)
AC_MSG_RESULT([$lyx_cv_with_included_boost])
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
AC_LANG_PUSH(C++)
save_LIBS=$LIBS
LIBS="$save_LIBS -lboost_signals -lm"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/signal.hpp>], [boost::signal<void ()> s;])], [lyx_boost_plain=yes], [])
LIBS="$save_LIBS -lboost_signals-mt -lm $LIBTHREAD"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/signal.hpp>], [boost::signal<void ()> s;])], [lyx_boost_mt=yes], [])
LIBS=$save_LIBS
AC_LANG_POP(C++)
if test x$lyx_boost_mt = xyes ; then
BOOST_MT="-mt"
else
BOOST_MT=""
if test x$lyx_boost_plain != xyes -a x$lyx_boost_underscore != xyes ; then
if test x$lyx_boost_plain != xyes ; then
LYX_ERROR([No suitable boost library found (do not use --without-included-boost)])
fi
fi
AC_SUBST(BOOST_SEP)
AC_SUBST(BOOST_MT)
fi
])

View File

@ -92,4 +92,4 @@ What's new
* BUILD/INSTALLATION
- Fix building with system boost on FreeBSD.