From e719aa8ed98a9fdef1d2ee3beeec2d748a96b7ab Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Fri, 5 Jun 2015 14:44:12 +1200
Subject: Qt4: Prevent crash on Haiku when clicking in a document


diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp
index 024c680..e3369b3 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -798,7 +798,7 @@ void GuiWorkArea::mousePressEvent(QMouseEvent * e)
 		return;
 	}
 
-#if (QT_VERSION < 0x050000)
+#if (QT_VERSION < 0x050000) && !defined(__HAIKU__)
 	inputContext()->reset();
 #endif
 
-- 
2.2.2


From ee4014ed1fa9107aaf859152672e53a1d4f8aed6 Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Fri, 5 Jun 2015 14:49:00 +1200
Subject: configure: also search for sockets in libnetwork


diff --git a/configure.ac b/configure.ac
index 8a8326b..935baa1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,8 +188,8 @@ save_LIBS="$LIBS"
 LIBS=
 AC_CHECK_FUNCS(fcntl,
   [AC_SEARCH_LIBS([gethostbyname], [nsl])
-   AC_SEARCH_LIBS([socket], [socket], [],
-     [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
+   AC_SEARCH_LIBS([socket], [socket network], [],
+     [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl -lnetwork $LIBS"],
 		[], [-lnsl])])],
   [lyx_client_subdir=false])
 AC_SUBST(SOCKET_LIBS,$LIBS)
-- 
2.2.2


From 77f718b5259891b8509247981ebcc3e505262dff Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Fri, 5 Jun 2015 15:13:06 +1200
Subject: autotools: search for libm when using system boost libraries


diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 61ea48d..b8e41ed 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -313,11 +313,12 @@ AC_DEFUN([LYX_USE_INCLUDED_BOOST],[
 	AC_MSG_RESULT([$lyx_cv_with_included_boost])
 	if test x$lyx_cv_with_included_boost != xyes ; then
 		AC_LANG_PUSH(C++)
+		AC_SEARCH_LIBS(cos, [m])
 		save_LIBS=$LIBS
 
-		LIBS="$save_LIBS -lboost_signals -lm"
+		LIBS="$save_LIBS -lboost_signals"
 		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"
+		LIBS="$save_LIBS -lboost_signals-mt $LIBTHREAD"
 		AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/signal.hpp>], [boost::signal<void ()> s;])], [lyx_boost_mt=yes], [])
 
 		LIBS=$save_LIBS
-- 
2.2.2

