OpenBSD support

This commit is contained in:
Andrew Pamment 2018-01-19 17:13:06 +10:00
parent 6dbd32b7bc
commit 522343e0f8
10 changed files with 183 additions and 2 deletions

View File

@ -18,6 +18,10 @@ endif
ifeq ($(OS), SunOS) ifeq ($(OS), SunOS)
MAKEFILE=Makefile.sunos MAKEFILE=Makefile.sunos
endif endif
ifeq ($(OS), OpenBSD)
MAKEFILE=Makefile.openbsd
endif
all: magicka all: magicka
.PHONY: magicka www clean cleanwww .PHONY: magicka www clean cleanwww

75
src/Makefile.openbsd Normal file
View File

@ -0,0 +1,75 @@
CC=cc
CFLAGS=-std=gnu99 -I/usr/local/include -I../deps/
DEPS = bbs.h
JAMLIB = ../deps/jamlib/jamlib.a
ZMODEM = ../deps/Xmodem/libzmodem.a
LUA = ../deps/lua/liblua.a
ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a
JSMN = ../deps/jsmn/libjsmn.a
CDK = ../deps/cdk-5-20161210/libcdk.a
all: magicka magimail magiedit ticproc mgpost magichat fileapprove magiftpd
${LUA}:
cd ../deps/lua && $(MAKE) -f Makefile bsd MAKEFLAGS=
${JAMLIB}:
cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS=
${ZMODEM}:
cd ../deps/Xmodem && $(MAKE) MAKEFLAGS=
${ODOORS}:
cd ../deps/odoors/ && $(MAKE)
$(JSMN):
cd ../deps/jsmn/ && $(MAKE)
$(CDK):
cd ../deps/cdk-5.0-20161210/ && export CPPFLAGS=-I/usr/pkg/include && ./configure --with-ncurses
cd ../deps/cdk-5.0-20161210/ && $(MAKE)
OBJ = inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o hashmap/hashmap.o menus.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN}
$(CC) -o ../magicka $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv
magiedit: $(ODOORS)
cd ../utils/magiedit && $(MAKE)
magimail: $(JAMLIB)
cd ../utils/magimail && $(MAKE) freebsd
ticproc:
cd ../utils/ticproc && $(MAKE)
mgpost: $(JAMLIB)
cd ../utils/mgpost && $(MAKE)
magichat: $(JSMN)
cd ../utils/magichat && $(MAKE)
fileapprove: $(CDK)
cd ../utils/fileapprove && $(MAKE)
magiftpd:
cd ../utils/magiftpd && $(MAKE)
.PHONY: clean
clean:
rm -f $(OBJ) ../magicka
cd ../deps/lua && $(MAKE) clean
cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean
cd ../deps/Xmodem && $(MAKE) clean
cd ../utils/magimail && $(MAKE) cleanfreebsd
cd ../utils/magiedit && $(MAKE) clean
cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s`
cd ../utils/ticproc && $(MAKE) clean
cd ../utils/mgpost && $(MAKE) clean
cd ../utils/magichat && $(MAKE) clean
cd ../deps/cdk-5.0-20161210 && $(MAKE) clean
cd ../utils/fileapprove && $(MAKE) clean
cd ../utils/magiftpd && $(MAKE) clean

81
src/Makefile.openbsd.WWW Normal file
View File

@ -0,0 +1,81 @@
CC=cc
CFLAGS=-std=gnu99 -I/usr/local/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1
DEPS = bbs.h
JAMLIB = ../deps/jamlib/jamlib.a
ZMODEM = ../deps/Xmodem/libzmodem.a
LUA = ../deps/lua/liblua.a
B64 = ../deps/libb64-1.2/src/libb64.a
MICROHTTPD=-lmicrohttpd
ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a
JSMN = ../deps/jsmn/libjsmn.a
CDK = ../deps/cdk-5-20161210/libcdk.a
all: magicka magimail magiedit ticproc mgpost magichat fileapprove magiftpd
${LUA}:
cd ../deps/lua && $(MAKE) -f Makefile bsd MAKEFLAGS=
${JAMLIB}:
cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS=
${ZMODEM}:
cd ../deps/Xmodem && $(MAKE) MAKEFLAGS=
${B64}:
cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS=
${ODOORS}:
cd ../deps/odoors/ && $(MAKE)
$(JSMN):
cd ../deps/jsmn/ && $(MAKE)
$(CDK):
cd ../deps/cdk-5.0-20161210/ && export CPPFLAGS=-I/usr/pkg/include && ./configure --with-ncurses
cd ../deps/cdk-5.0-20161210/ && $(MAKE)
OBJ = ../deps/aha/aha.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o www.o www_email.o www_msgs.o www_last10.o hashmap/hashmap.o menus.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${B64} ${JSMN}
$(CC) -o ../magicka $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv $(MICROHTTPD)
magiedit: $(ODOORS)
cd ../utils/magiedit && $(MAKE)
magimail: $(JAMLIB)
cd ../utils/magimail && $(MAKE) freebsd
ticproc:
cd ../utils/ticproc && $(MAKE)
mgpost: $(JAMLIB)
cd ../utils/mgpost && $(MAKE)
magichat: $(JSMN)
cd ../utils/magichat && $(MAKE)
fileapprove: $(CDK)
cd ../utils/fileapprove && $(MAKE)
magiftpd:
cd ../utils/magiftpd && $(MAKE)
.PHONY: clean
clean:
rm -f $(OBJ) ../magicka
cd ../deps/lua && $(MAKE) clean
cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean
cd ../deps/Xmodem && $(MAKE) clean
cd ../deps/libb64-1.2 && $(MAKE) clean
cd ../utils/magimail && $(MAKE) cleanfreebsd
cd ../utils/magiedit && $(MAKE) clean
cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s`
cd ../utils/ticproc && $(MAKE) clean
cd ../utils/mgpost && $(MAKE) clean
cd ../utils/magichat && $(MAKE) clean
cd ../deps/cdk-5.0-20161210 && $(MAKE) clean
cd ../utils/fileapprove && $(MAKE) clean
cd ../utils/magiftpd && $(MAKE) clean

View File

@ -7,6 +7,9 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#if defined(__OpenBSD__)
# include <sys/select.h>
#endif
#include "../deps/jsmn/jsmn.h" #include "../deps/jsmn/jsmn.h"
#include "bbs.h" #include "bbs.h"

View File

@ -8,7 +8,7 @@
#include <b64/cdecode.h> #include <b64/cdecode.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
#include "bbs.h" #include "bbs.h"

View File

@ -15,6 +15,11 @@ ifeq ($(OS), NetBSD)
CFLAGS=-I/usr/pkg/include CFLAGS=-I/usr/pkg/include
LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 -lncurses LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 -lncurses
endif endif
ifeq ($(OS), OpenBSD)
CC=cc
CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib -lsqlite3 -lncurses
endif
ifeq ($(OS), Linux) ifeq ($(OS), Linux)
CC=gcc CC=gcc
CFLAGS= CFLAGS=

View File

@ -7,6 +7,9 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#if defined(__OpenBSD__)
# include <sys/select.h>
#endif
#include "../../deps/jsmn/jsmn.h" #include "../../deps/jsmn/jsmn.h"
struct chat_msg { struct chat_msg {

View File

@ -15,6 +15,11 @@ ifeq ($(OS), NetBSD)
CFLAGS=-I/usr/pkg/include CFLAGS=-I/usr/pkg/include
LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 -lcrypto LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 -lcrypto
endif endif
ifeq ($(OS), OpenBSD)
CC=cc
CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib -lsqlite3 -lcrypto
endif
ifeq ($(OS), Linux) ifeq ($(OS), Linux)
CC=gcc CC=gcc
CFLAGS= CFLAGS=

View File

@ -46,7 +46,7 @@ else
endif endif
# Commands # Commands
ifeq ($(OS), $(filter $(OS), FreeBSD DragonFly)) ifeq ($(OS), $(filter $(OS), FreeBSD DragonFly OpenBSD))
CC = cc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -L/usr/local/lib -I $(INCDIR) -I ../../../deps/ -I/usr/local/include -Wall CC = cc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -L/usr/local/lib -I $(INCDIR) -I ../../../deps/ -I/usr/local/include -Wall
else else
CC = gcc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -I $(INCDIR) -I ../../../deps/ -Wall CC = gcc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -I $(INCDIR) -I ../../../deps/ -Wall

View File

@ -15,6 +15,11 @@ ifeq ($(OS), NetBSD)
CFLAGS=-I/usr/pkg/include CFLAGS=-I/usr/pkg/include
LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib
endif endif
ifeq ($(OS), OpenBSD)
CC=cc
CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
endif
ifeq ($(OS), Linux) ifeq ($(OS), Linux)
CC=gcc CC=gcc
CFLAGS= CFLAGS=