From 240d8108350822869d635a36611574bc1c7231fa Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 26 Sep 2011 15:51:28 +0000 Subject: [PATCH] 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. --- config/lyxinclude.m4 | 18 +++++++++++++----- status.20x | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 458fc8ea85..0b2927f536 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -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 s;])], [lyx_boost_plain=yes], []) + LIBS="$save_LIBS -lboost_signals-mt -lm $LIBTHREAD" + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [boost::signal 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 ]) diff --git a/status.20x b/status.20x index f0b7cf2320..f1bc55911c 100644 --- a/status.20x +++ b/status.20x @@ -92,4 +92,4 @@ What's new * BUILD/INSTALLATION - +- Fix building with system boost on FreeBSD. -- 2.39.5