From 17b139834747ae40fb5971b28f2a3fd9699a94aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 19 Feb 2022 19:29:19 +0100
Subject: Teaching m4 about Haiku


diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4
index 56d81a6..1595cac 100644
--- a/ext/bz2/config.m4
+++ b/ext/bz2/config.m4
@@ -6,6 +6,8 @@ PHP_ARG_WITH([bz2],
 if test "$PHP_BZ2" != "no"; then
   if test -r $PHP_BZ2/include/bzlib.h; then
     BZIP_DIR=$PHP_BZ2
+  elif test -r $PHP_BZ2/develop/headers/bzlib.h; then
+    BZIP_DIR=$PHP_BZ2
   else
     AC_MSG_CHECKING(for BZip2 in default path)
     for i in /usr/local /usr; do
diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4
index 536785f..8545219 100644
--- a/ext/gettext/config.m4
+++ b/ext/gettext/config.m4
@@ -8,6 +8,10 @@ if test "$PHP_GETTEXT" != "no"; then
     test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
   done
 
+  for i in $PHP_GETTEXT; do
+    test -r $i/develop/headers/libintl.h && GETTEXT_DIR=$i && break
+  done
+
   if test -z "$GETTEXT_DIR"; then
     AC_MSG_ERROR(Cannot locate header file libintl.h)
   fi
diff --git a/ext/readline/config.m4 b/ext/readline/config.m4
index 209f92b..3855c8d 100644
--- a/ext/readline/config.m4
+++ b/ext/readline/config.m4
@@ -19,6 +19,10 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
     test -f $i/include/readline/readline.h && READLINE_DIR=$i && break
   done
 
+  for i in $PHP_READLINE; do
+    test -f $i/develop/headers/readline/readline.h && READLINE_DIR=$i && break
+  done
+
   if test -z "$READLINE_DIR"; then
     AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h)
   fi
-- 
2.30.2


From c776caa6e22d5e1530eacc04c1843152e2798c8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 19 Feb 2022 19:31:37 +0100
Subject: PCNTL build fix


diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index c1c99ab..9fefeff 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -50,6 +50,10 @@
 # define NSIG 32
 #endif
 
+#ifndef SIGIO
+# define SIGIO -1
+#endif
+
 ZEND_DECLARE_MODULE_GLOBALS(pcntl)
 static PHP_GINIT_FUNCTION(pcntl);
 
-- 
2.30.2

