From 090a2fb1ad6b0f2a2f9eef76a5c829944fa029be Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 1 Jul 2021 22:03:21 +0300
Subject: Haiku patch


diff --git a/configure.ac b/configure.ac
index 4fdd14a..d8b7fd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,6 +189,15 @@ hl_oldLibs=$LIBS
 
 AC_CHECK_FUNC([connect], [hl_checkSocket=0], [hl_checkSocket=1])
 
+AS_IF([test "$hl_checkSocket" = 1], [
+        AC_CHECK_LIB([network],
+                     [main],
+                     [NET_LIBS="$NET_LIBS -lnetwork"
+                      hl_checkSocket=0],
+                     [],
+                     [])
+        ])
+
 AS_IF([test "$hl_checkSocket" = 1], [
 	AC_CHECK_LIB([socket],
 		     [main],
diff --git a/rigs/aor/ar7030p_utils.c b/rigs/aor/ar7030p_utils.c
index 4724915..dce0292 100644
--- a/rigs/aor/ar7030p_utils.c
+++ b/rigs/aor/ar7030p_utils.c
@@ -33,6 +33,8 @@
 #include "serial.h"
 #include "idx_builtin.h"
 
+#undef PAGE_SIZE
+
 static enum PAGE_e curPage = NONE; /* Current memory page */
 static unsigned int curAddr = 65535; /* Current page address */
 static enum LOCK_LVL_e curLock = LOCK_0; /* Current lock level */
diff --git a/src/event.c b/src/event.c
index 03f4e76..0438bad 100644
--- a/src/event.c
+++ b/src/event.c
@@ -70,7 +70,7 @@
 #define CHECK_RIG_ARG(r) (!(r) || !(r)->caps || !(r)->state.comm_state)
 
 
-#ifdef HAVE_SIGACTION
+#if defined(HAVE_SIGACTION) && !defined(__HAIKU__)
 static struct sigaction hamlib_trn_oldact, hamlib_trn_poll_oldact;
 
 #ifdef HAVE_SIGINFO_T
@@ -94,7 +94,7 @@ extern int foreach_opened_rig(int (*cfunc)(RIG *, rig_ptr_t), rig_ptr_t data);
  */
 int add_trn_rig(RIG *rig)
 {
-#ifdef HAVE_SIGACTION
+#if defined(HAVE_SIGACTION) && !defined(__HAIKU__)
     struct sigaction act;
     int status;
 
@@ -180,7 +180,7 @@ int add_trn_rig(RIG *rig)
  */
 int remove_trn_rig(RIG *rig)
 {
-#ifdef HAVE_SIGACTION
+#if defined(HAVE_SIGACTION) && !defined(__HAIKU__)
     int status;
 
     /* assert(rig->caps->transceive == RIG_TRN_RIG); */
@@ -215,7 +215,7 @@ int remove_trn_rig(RIG *rig)
 }
 
 
-#ifdef HAVE_SIGACTION
+#if defined(HAVE_SIGACTION) && !defined(__HAIKU__)
 
 
 /*
@@ -224,7 +224,7 @@ int remove_trn_rig(RIG *rig)
  */
 static int add_trn_poll_rig(RIG *rig)
 {
-#ifdef HAVE_SIGACTION
+#if defined(HAVE_SIGACTION) && !defined(__HAIKU__)
     struct sigaction act;
     int status;
 
-- 
2.30.2


From ed772628e0e5ecfd37804846669a230c6e03430d Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 5 Jan 2022 15:02:32 +1000
Subject: Fix missing simbols


diff --git a/src/event.c b/src/event.c
index 0438bad..039a869 100644
--- a/src/event.c
+++ b/src/event.c
@@ -215,7 +215,7 @@ int remove_trn_rig(RIG *rig)
 }
 
 
-#if defined(HAVE_SIGACTION) && !defined(__HAIKU__)
+#if defined(HAVE_SIGACTION)
 
 
 /*
-- 
2.30.2

