port to OpenBSD (#2157)

This commit is contained in:
kasicass
2026-06-06 15:03:28 +08:00
committed by GitHub
parent efc1d8d408
commit 83cff80c91
4 changed files with 9 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ CMCFLAGS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris openbsd
LUA_A= liblua.a LUA_A= liblua.a
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
@@ -112,7 +112,7 @@ c89:
@echo '*** with LUA_USE_C89 to ensure consistency' @echo '*** with LUA_USE_C89 to ensure consistency'
@echo '' @echo ''
FreeBSD NetBSD OpenBSD freebsd: FreeBSD NetBSD OpenBSD freebsd openbsd:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
generic: $(ALL) generic: $(ALL)

View File

@@ -13,7 +13,7 @@ For Linux, install autoconf first for jemalloc:
``` ```
git clone https://github.com/cloudwu/skynet.git git clone https://github.com/cloudwu/skynet.git
cd skynet cd skynet
make 'PLATFORM' # PLATFORM can be linux, macosx, freebsd now make 'PLATFORM' # PLATFORM can be linux, macosx, freebsd, openbsd now
``` ```
Or: Or:

View File

@@ -1,5 +1,5 @@
PLAT ?= none PLAT ?= none
PLATS = linux freebsd macosx mingw PLATS = linux freebsd openbsd macosx mingw
CC ?= gcc CC ?= gcc
@@ -25,6 +25,7 @@ EXPORT := -Wl,-E
linux : PLAT = linux linux : PLAT = linux
macosx : PLAT = macosx macosx : PLAT = macosx
freebsd : PLAT = freebsd freebsd : PLAT = freebsd
openbsd : PLAT = openbsd
mingw : PLAT = mingw mingw : PLAT = mingw
macosx : SHARED := -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup macosx : SHARED := -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
@@ -34,10 +35,10 @@ linux freebsd : SKYNET_LIBS += -lrt
# Turn off jemalloc and malloc hook on macosx # Turn off jemalloc and malloc hook on macosx
macosx : MALLOC_STATICLIB := openbsd macosx : MALLOC_STATICLIB :=
macosx : SKYNET_DEFINES :=-DNOUSE_JEMALLOC openbsd macosx : SKYNET_DEFINES :=-DNOUSE_JEMALLOC
linux macosx freebsd : linux macosx freebsd openbsd :
$(MAKE) all PLAT=$@ SKYNET_LIBS="$(SKYNET_LIBS)" SHARED="$(SHARED)" EXPORT="$(EXPORT)" MALLOC_STATICLIB="$(MALLOC_STATICLIB)" SKYNET_DEFINES="$(SKYNET_DEFINES)" $(MAKE) all PLAT=$@ SKYNET_LIBS="$(SKYNET_LIBS)" SHARED="$(SHARED)" EXPORT="$(EXPORT)" MALLOC_STATICLIB="$(MALLOC_STATICLIB)" SKYNET_DEFINES="$(SKYNET_DEFINES)"
mingw : mingw :

View File

@@ -6,6 +6,7 @@
#include "spinlock.h" #include "spinlock.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <unistd.h> #include <unistd.h>