From c412ef082197a591bcbce15241e1d3998fbe199a Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 29 Sep 2021 17:57:33 +0000
Subject: Set default font for Haiku


diff --git a/lib/common/const.h b/lib/common/const.h
index 91fb980..54df290 100644
--- a/lib/common/const.h
+++ b/lib/common/const.h
@@ -62,6 +62,8 @@
 #define		MIN_FONTSIZE		1.0
 #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
 #define		DEFAULT_FONTNAME	"TimesNewRomanPSMT"
+elif defined (__HAIKU__)
+#define 	DEFAULT_FONTNAME	"NotoSans"
 #else
 #define		DEFAULT_FONTNAME	"Times-Roman"
 #endif
-- 
2.30.2


From 69005818b814d28e3dfa26b967559d1c9de3da43 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 29 Sep 2021 17:59:31 +0000
Subject: Add check for libnetwork


diff --git a/configure.ac b/configure.ac
index fe3f2be..8135833 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1474,6 +1474,9 @@ AC_ARG_WITH(extralibdir,
 dnl -----------------------------------
 dnl ...borrow test for -lsocket -lnsl from tk8.3.3/unix/configure.in
 
+dnl Check for Haiku libnetwork
+AC_CHECK_LIB([network], [socket])
+
 save_LIBS=$LIBS
 LIBS=
 tk_checkBoth=0
-- 
2.30.2


From f32f872da01af05f843bcbddc39e92a5760b8df1 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 29 Sep 2021 18:02:07 +0000
Subject: Set Haiku font directories


diff --git a/configure.ac b/configure.ac
index 8135833..81e810f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,7 @@ UWIN=no
 CYGWIN=no
 MINGW32=no
 DARWIN9=no
+HAIKU=no
 case "${host_os}" in
   *uwin* )
 	UWIN=yes
@@ -185,6 +186,20 @@ case "${host_os}" in
 		;;
         esac
 	;;
+	*haiku* )
+	HAIKU=yes
+	HAIKU_SYSTEM_FONTPATH=`finddir B_SYSTEM_FONTS_DIRECTORY`
+	HAIKU_SYSTEM_NONPACKAGED_FONTPATH=`finddir B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY`
+	HAIKU_USER_FONTPATH=`finddir B_USER_FONTS_DIRECTORY`
+	HAIKU_USER_NONPACKAGED_FONTPATH=`finddir B_USER_NONPACKAGED_FONTS_DIRECTORY`
+	DEFAULT_FONTPATH="$HAIKU_SYSTEM_FONTPATH:$HAIKU_SYSTEM_FONTPATH/ttfonts:$HAIKU_SYSTEM_FONTPATH/psfonts"
+	DEFAULT_FONTPATH="$DEFAULT_FONTPATH:$HAIKU_SYSTEM_NONPACKAGED_FONTPATH:$HAIKU_SYSTEM_NONPACKAGED_FONTPATH/ttfonts:$HAIKU_SYSTEM_NONPACKAGED_FONTPATH/psfonts"
+	DEFAULT_FONTPATH="$DEFAULT_FONTPATH:$HAIKU_USER_FONTPATH:$HAIKU_USER_FONTPATH/ttfonts:$HAIKU_USER_FONTPATH/psfonts"
+	DEFAULT_FONTPATH="$DEFAULT_FONTPATH:$HAIKU_USER_NONPACKAGED_FONTPATH:$HAIKU_USER_NONPACKAGED_FONTPATH/ttfonts:$HAIKU_USER_NONPACKAGED_FONTPATH/psfonts"
+	PATHSEPARATOR=":"
+        NO_POSTSCRIPT_ALIAS=1
+	BROWSER="open"
+	;;
   * ) # This sucks!  Whatever happened to standards for file system layout?   (Good job its no longer used unless fontconfig is unavailable.)
 	DEFAULT_FONTPATH="/usr/share/fonts/sun/TrueType:/usr/share/fonts/TrueType:/usr/X11/lib/X11/fonts/TrueType:/usr/share/fonts/sun/Type1:/usr/openwin/lib/X11/fonts/Type1:/usr/share/fonts/X11/Type1:/usr/share/fonts/default/Type1:/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:/usr/common/share/fonts/ttf";
 	PATHSEPARATOR=":"
@@ -439,7 +454,7 @@ AC_CHECK_HEADERS( \
 	unistd.h strings.h stat.h \
 	sys/time.h sys/types.h sys/select.h sys/socket.h \
 	sys/stat.h sys/mman.h \
-	sys/ioctl.h sys/inotify.h)
+	sys/ioctl.h sys/inotify.h sysexits.h)
 
 # Internationalization macros
 # AM_GNU_GETTEXT
-- 
2.30.2

