summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2019-03-17 21:33:03 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-03-21 20:24:37 +0000
commit33d6ea6d65d97d2eb5a962b4b7ead21ea0176110 (patch)
treeb26d72315bdd093d98db23a051d754285e441975
parent80bbeba5ca28d9901fa1b66ae4cb08ba58018bb8 (diff)
downloadluxio-33d6ea6d65d97d2eb5a962b4b7ead21ea0176110.tar.gz
Enable compilation on OpenBSD
-rw-r--r--Makefile4
-rw-r--r--findlua.mk8
-rw-r--r--luxio.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7b98d0b..5826b73 100644
--- a/Makefile
+++ b/Makefile
@@ -78,7 +78,7 @@ luxio-5.2: lua-5.2.c luxio-5.2.o
###
luxio-5.1.o: luxio.c luxio_constants.inc
- $(CC) $(CFLAGS) -fPIC $(LUA51_INC) -c $< -o $@
+ $(CC) $(CFLAGS) -fPIC $(EXTRA_INC) $(LUA51_INC) -c $< -o $@
luxio-5.2.o: luxio.c luxio_constants.inc
- $(CC) $(CFLAGS) -fPIC $(LUA52_INC) -c $< -o $@
+ $(CC) $(CFLAGS) -fPIC $(EXTRA_INC) $(LUA52_INC) -c $< -o $@
diff --git a/findlua.mk b/findlua.mk
index 45012b7..895ec1a 100644
--- a/findlua.mk
+++ b/findlua.mk
@@ -17,6 +17,14 @@ else
EXTRA_LIBS :=
endif
+ifeq ($(HOST_OS),OpenBSD)
+ # Linux and FreeBSD have a 'builtin' iconv
+ EXTRA_LIBS := $(EXTRA_LIBS) -L /usr/local/lib -liconv
+ EXTRA_INC := -I /usr/local/include
+else
+ EXTRA_INC :=
+endif
+
NAKED_LUA_VER := $(shell (pkg-config --exists lua && \
pkg-config --modversion lua || \
pkg-config --variable V lua) | cut -d. -f1-2)
diff --git a/luxio.c b/luxio.c
index e952c47..1dca902 100644
--- a/luxio.c
+++ b/luxio.c
@@ -2550,7 +2550,7 @@ luxio_nanosleep(lua_State *L) /* 14.2.5 */
POSIX message passing is not available on all platforms.
@section msgpass
*/
-#if defined(_POSIX_MESSAGE_PASSING)
+#if _POSIX_MESSAGE_PASSING >= 0
#include <mqueue.h>
@@ -4592,7 +4592,7 @@ luxio_functions[] = {
{ "nanosleep", luxio_nanosleep },
-#if defined(_POSIX_MESSAGE_PASSING)
+#if _POSIX_MESSAGE_PASSING >= 0
#if _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L
{ "mq_timedsend", luxio_mq_timedsend },