From 8bc6c0a5f5bfdb168dc42754b0b5750cccf24dbf Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 26 Dec 2018 23:07:26 +0100
Subject: Import fixed version of tecmake.


diff --git a/tecmake.mak b/tecmake.mak
index 25250b6..2b6c850 100755
--- a/tecmake.mak
+++ b/tecmake.mak
@@ -568,6 +568,10 @@ ifneq ($(findstring MacOS, $(TEC_UNAME)), )
   FREETYPE_INC := /sw/include/freetype2
 endif
 
+ifneq ($(findstring Haiku, $(TEC_UNAME)), )
+  FREETYPE_INC := $(shell pkg-config --cflags-only-I freetype2 | cut -b 3-)
+endif
+
 # Definitions for GTK
 ifdef GTK_BASE
   GTK := $(GTK_BASE)
@@ -634,6 +638,11 @@ ifneq ($(findstring CentOS, $(TEC_UNAME)), )
   endif
 endif
 
+ifneq ($(findstring Haiku, $(TEC_UNAME)), )
+  UNIX_POSIX = Yes
+  STDLDFLAGS := -shared -Wl,-soname=lib$(TARGETNAME).so
+endif
+
 ifneq ($(findstring IRIX, $(TEC_UNAME)), )
   UNIX_POSIX = Yes
   ifndef NO_LOCAL_LD
@@ -1005,7 +1014,12 @@ ifdef USE_LUA
     endif
   endif
 
-  LUA_INC ?= $(LUA)/include
+  ifneq ($(findstring Haiku, $(TEC_UNAME)), )
+    LUA_INC ?= /system/develop/headers/lua5.1
+  else
+    LUA_INC ?= $(LUA)/include
+  endif
+
   INCLUDES += $(LUA_INC)
 
   LUA_BIN ?= $(LUA)/bin/$(TEC_UNAME)
-- 
2.19.1

