diff options
| author | cos <cos> | 2025-02-15 09:32:39 +0100 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2025-02-25 12:47:59 +0100 |
| commit | f5f01c663816235bed38b3056771c6898744f567 (patch) | |
| tree | c0281134ff27832d0ad6c8da2ea4b721e592798d | |
| parent | b8b57ba75020c224ae6c5f068cd3514c9a4d7d91 (diff) | |
| download | luasystem-f5f01c663816235bed38b3056771c6898744f567.tar.gz luasystem-f5f01c663816235bed38b3056771c6898744f567.tar.bz2 luasystem-f5f01c663816235bed38b3056771c6898744f567.zip | |
Add support for OpenBSD+FreeBSD platforms
| -rw-r--r-- | .github/workflows/build.yml | 17 | ||||
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | src/Makefile | 25 |
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" | ||
| @@ -18,12 +18,15 @@ endif | |||
| 18 | ifeq ($(UNAME_S),FreeBSD) | 18 | ifeq ($(UNAME_S),FreeBSD) |
| 19 | PLAT=freebsd | 19 | PLAT=freebsd |
| 20 | endif | 20 | endif |
| 21 | ifeq ($(UNAME_S),OpenBSD) | ||
| 22 | PLAT=openbsd | ||
| 23 | endif | ||
| 21 | ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) | 24 | ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) |
| 22 | PLAT=mingw | 25 | PLAT=mingw |
| 23 | endif | 26 | endif |
| 24 | endif | 27 | endif |
| 25 | PLAT?= linux | 28 | PLAT?= linux |
| 26 | PLATS= macosx linux win32 mingw freebsd | 29 | PLATS= macosx linux win32 mingw freebsd openbsd |
| 27 | 30 | ||
| 28 | all: $(PLAT) | 31 | all: $(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 | |||
| 17 | ifeq ($(UNAME_S),FreeBSD) | 17 | ifeq ($(UNAME_S),FreeBSD) |
| 18 | PLAT=freebsd | 18 | PLAT=freebsd |
| 19 | endif | 19 | endif |
| 20 | ifeq ($(UNAME_S),OpenBSD) | ||
| 21 | PLAT=openbsd | ||
| 22 | endif | ||
| 20 | ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) | 23 | ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) |
| 21 | PLAT=mingw | 24 | PLAT=mingw |
| 22 | endif | 25 | endif |
| @@ -64,6 +67,13 @@ LUAPREFIX_freebsd?=/usr/local/ | |||
| 64 | CDIR_freebsd?=lib/lua/$(LUA_VERSION) | 67 | CDIR_freebsd?=lib/lua/$(LUA_VERSION) |
| 65 | LDIR_freebsd?=share/lua/$(LUA_VERSION) | 68 | LDIR_freebsd?=share/lua/$(LUA_VERSION) |
| 66 | 69 | ||
| 70 | # LUAINC_openbsd: | ||
| 71 | LUAINC_openbsd_base?=/usr/local/include | ||
| 72 | LUAINC_openbsd?=$(LUAINC_openbsd_base)/lua-$(LUA_VERSION) | ||
| 73 | LUAPREFIX_openbsd?=/usr/local/ | ||
| 74 | CDIR_openbsd?=lib/lua/$(LUA_VERSION) | ||
| 75 | LDIR_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 | ||
| 176 | SO_openbsd=so | ||
| 177 | O_openbsd=o | ||
| 178 | CC_openbsd=clang | ||
| 179 | DEF_openbsd= | ||
| 180 | CFLAGS_openbsd= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \ | ||
| 181 | -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden | ||
| 182 | LDFLAGS_openbsd=-O -shared -fpic -o | ||
| 183 | LD_openbsd=clang | ||
| 184 | |||
| 185 | #------ | ||
| 186 | # Compiler and linker settings | ||
| 165 | # for MingW | 187 | # for MingW |
| 166 | SO_mingw=dll | 188 | SO_mingw=dll |
| 167 | O_mingw=o | 189 | O_mingw=o |
| @@ -227,6 +249,9 @@ default: $(PLAT) | |||
| 227 | freebsd: | 249 | freebsd: |
| 228 | $(MAKE) all PLAT=freebsd | 250 | $(MAKE) all PLAT=freebsd |
| 229 | 251 | ||
| 252 | openbsd: | ||
| 253 | $(MAKE) all PLAT=openbsd | ||
| 254 | |||
| 230 | macosx: | 255 | macosx: |
| 231 | $(MAKE) all PLAT=macosx | 256 | $(MAKE) all PLAT=macosx |
| 232 | 257 | ||
