DragonFly BSD support

This commit is contained in:
Andrew Pamment 2017-10-18 17:18:28 +10:00
parent 1b0c1a6906
commit 87601156c6
6 changed files with 58 additions and 41 deletions

View File

@ -1,5 +1,8 @@
OS := $(shell uname -s) OS := $(shell uname -s)
ifeq ($(OS), DragonFly)
MAKEFILE=Makefile.freebsd
endif
ifeq ($(OS), FreeBSD) ifeq ($(OS), FreeBSD)
MAKEFILE=Makefile.freebsd MAKEFILE=Makefile.freebsd
endif endif

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>
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__DragonFly__)
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
#include "bbs.h" #include "bbs.h"

View File

@ -5,6 +5,11 @@ ifeq ($(OS), FreeBSD)
CFLAGS=-I/usr/local/include CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib LDFLAGS=-L/usr/local/lib
endif endif
ifeq ($(OS), DragonFly)
CC=cc
CFLAGS=-I/usr/local/include -I/usr/local/include/ncurses
LDFLAGS=-L/usr/local/lib
endif
ifeq ($(OS), NetBSD) ifeq ($(OS), NetBSD)
CC=cc CC=cc
CFLAGS=-I/usr/pkg/include CFLAGS=-I/usr/pkg/include
@ -23,7 +28,6 @@ endif
CC=cc CC=cc
CFLAGS=-I/usr/local/include
DEPS = fileapprove.c DEPS = fileapprove.c
OBJ = fileapprove.o OBJ = fileapprove.o

View File

@ -5,6 +5,11 @@ ifeq ($(OS), FreeBSD)
CFLAGS=-I/usr/local/include CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib LDFLAGS=-L/usr/local/lib
endif endif
ifeq ($(OS), DragonFly)
CC=cc
CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
endif
ifeq ($(OS), NetBSD) ifeq ($(OS), NetBSD)
CC=cc CC=cc
CFLAGS=-I/usr/pkg/include CFLAGS=-I/usr/pkg/include

View File

@ -40,7 +40,7 @@ MBOBJS = $(MBOBJS_MSG) $(MBOBJS_JAM) $(MBOBJS_SQ3)
DEFS = $(PLATFORMDEF) $(MBDEFS) $(NLDEFS) DEFS = $(PLATFORMDEF) $(MBDEFS) $(NLDEFS)
# Commands # Commands
ifeq ($(OS), FreeBSD) ifeq ($(OS), $(filter $(OS), FreeBSD DragonFly))
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

@ -1,38 +1,43 @@
OS := $(shell uname -s) OS := $(shell uname -s)
ifeq ($(OS), FreeBSD) ifeq ($(OS), FreeBSD)
CC=cc CC=cc
CFLAGS=-I/usr/local/include CFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib LDFLAGS=-L/usr/local/lib
endif endif
ifeq ($(OS), NetBSD) ifeq ($(OS), DragonFly)
CC=cc CC=cc
CFLAGS=-I/usr/pkg/include CFLAGS=-I/usr/local/include
LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib LDFLAGS=-L/usr/local/lib
endif endif
ifeq ($(OS), Linux) ifeq ($(OS), NetBSD)
CC=gcc CC=cc
CFLAGS= CFLAGS=-I/usr/pkg/include
LDFLAGS= LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib
endif endif
ifeq ($(OS), Darwin) ifeq ($(OS), Linux)
CC=cc CC=gcc
CFLAGS= CFLAGS=
LDFLAGS= LDFLAGS=
endif endif
ifeq ($(OS), Darwin)
CC=cc
DEPS = ticproc.c CFLAGS=
LDFLAGS=
OBJ = ticproc.o ../../src/inih/ini.o crc32.o endif
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
DEPS = ticproc.c
ticproc: $(OBJ) OBJ = ticproc.o ../../src/inih/ini.o crc32.o
$(CC) -o ticproc $^ $(CFLAGS) $(LDFLAGS) -lsqlite3 %.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
.PHONY: clean
clean: ticproc: $(OBJ)
rm -f $(OBJ) ticproc $(CC) -o ticproc $^ $(CFLAGS) $(LDFLAGS) -lsqlite3
.PHONY: clean
clean:
rm -f $(OBJ) ticproc