aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2025-02-15 09:32:39 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2025-02-25 12:47:59 +0100
commitf5f01c663816235bed38b3056771c6898744f567 (patch)
treec0281134ff27832d0ad6c8da2ea4b721e592798d
parentb8b57ba75020c224ae6c5f068cd3514c9a4d7d91 (diff)
downloadluasystem-f5f01c663816235bed38b3056771c6898744f567.tar.gz
luasystem-f5f01c663816235bed38b3056771c6898744f567.tar.bz2
luasystem-f5f01c663816235bed38b3056771c6898744f567.zip
Add support for OpenBSD+FreeBSD platforms
-rw-r--r--.github/workflows/build.yml17
-rw-r--r--Makefile5
-rw-r--r--src/Makefile25
3 files changed, 46 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index dd28124..f0e7a81 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -127,3 +127,20 @@ jobs:
127 LUA_VERSION=5.4 luarocks54 make 127 LUA_VERSION=5.4 luarocks54 make
128 luarocks54 install busted 128 luarocks54 install busted
129 busted --exclude-tags=manual --Xoutput "--color" 129 busted --exclude-tags=manual --Xoutput "--color"
130
131 openbsd:
132 runs-on: ubuntu-latest
133 name: Run tests on OpenBSD
134 steps:
135 - uses: actions/checkout@v4
136
137 - name: Run tests inside OpenBSD VM
138 uses: vmactions/openbsd-vm@v1
139 with:
140 usesh: true
141 prepare: |
142 pkg_add luarocks-lua54
143 run: |
144 LUA_VERSION=5.4 luarocks-5.4 make
145 luarocks-5.4 install busted
146 busted --exclude-tags=manual --Xoutput "--color"
diff --git a/Makefile b/Makefile
index dd20ee9..9667829 100644
--- a/Makefile
+++ b/Makefile
@@ -18,12 +18,15 @@ endif
18ifeq ($(UNAME_S),FreeBSD) 18ifeq ($(UNAME_S),FreeBSD)
19 PLAT=freebsd 19 PLAT=freebsd
20endif 20endif
21ifeq ($(UNAME_S),OpenBSD)
22 PLAT=openbsd
23endif
21ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) 24ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW)
22 PLAT=mingw 25 PLAT=mingw
23endif 26endif
24endif 27endif
25PLAT?= linux 28PLAT?= linux
26PLATS= macosx linux win32 mingw freebsd 29PLATS= macosx linux win32 mingw freebsd openbsd
27 30
28all: $(PLAT) 31all: $(PLAT)
29 32
diff --git a/src/Makefile b/src/Makefile
index 6425a4a..7d96cc7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -17,6 +17,9 @@ endif
17ifeq ($(UNAME_S),FreeBSD) 17ifeq ($(UNAME_S),FreeBSD)
18 PLAT=freebsd 18 PLAT=freebsd
19endif 19endif
20ifeq ($(UNAME_S),OpenBSD)
21 PLAT=openbsd
22endif
20ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) 23ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW)
21 PLAT=mingw 24 PLAT=mingw
22endif 25endif
@@ -64,6 +67,13 @@ LUAPREFIX_freebsd?=/usr/local/
64CDIR_freebsd?=lib/lua/$(LUA_VERSION) 67CDIR_freebsd?=lib/lua/$(LUA_VERSION)
65LDIR_freebsd?=share/lua/$(LUA_VERSION) 68LDIR_freebsd?=share/lua/$(LUA_VERSION)
66 69
70# LUAINC_openbsd:
71LUAINC_openbsd_base?=/usr/local/include
72LUAINC_openbsd?=$(LUAINC_openbsd_base)/lua-$(LUA_VERSION)
73LUAPREFIX_openbsd?=/usr/local/
74CDIR_openbsd?=lib/lua/$(LUA_VERSION)
75LDIR_openbsd?=share/lua/$(LUA_VERSION)
76
67# where lua headers are found for mingw builds 77# where lua headers are found for mingw builds
68# LUAINC_mingw: 78# LUAINC_mingw:
69# /opt/local/include 79# /opt/local/include
@@ -162,6 +172,18 @@ LD_freebsd=gcc
162 172
163#------ 173#------
164# Compiler and linker settings 174# Compiler and linker settings
175# for FreeBSD
176SO_openbsd=so
177O_openbsd=o
178CC_openbsd=clang
179DEF_openbsd=
180CFLAGS_openbsd= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \
181 -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden
182LDFLAGS_openbsd=-O -shared -fpic -o
183LD_openbsd=clang
184
185#------
186# Compiler and linker settings
165# for MingW 187# for MingW
166SO_mingw=dll 188SO_mingw=dll
167O_mingw=o 189O_mingw=o
@@ -227,6 +249,9 @@ default: $(PLAT)
227freebsd: 249freebsd:
228 $(MAKE) all PLAT=freebsd 250 $(MAKE) all PLAT=freebsd
229 251
252openbsd:
253 $(MAKE) all PLAT=openbsd
254
230macosx: 255macosx:
231 $(MAKE) all PLAT=macosx 256 $(MAKE) all PLAT=macosx
232 257