From 87601156c6080b2f5a0a6aa799ebe77bd5cbc234 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 18 Oct 2017 17:18:28 +1000 Subject: [PATCH] DragonFly BSD support --- Makefile | 3 ++ src/www.c | 2 +- utils/fileapprove/Makefile | 6 ++- utils/magiftpd/Makefile | 5 ++ utils/magimail/src/Makefile.linux | 2 +- utils/ticproc/Makefile | 81 ++++++++++++++++--------------- 6 files changed, 58 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index 50804e9..219b170 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ OS := $(shell uname -s) +ifeq ($(OS), DragonFly) + MAKEFILE=Makefile.freebsd +endif ifeq ($(OS), FreeBSD) MAKEFILE=Makefile.freebsd endif diff --git a/src/www.c b/src/www.c index d9c9072..c6d750d 100644 --- a/src/www.c +++ b/src/www.c @@ -8,7 +8,7 @@ #include #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__DragonFly__) #include #endif #include "bbs.h" diff --git a/utils/fileapprove/Makefile b/utils/fileapprove/Makefile index 8ddeba7..9f42dbd 100644 --- a/utils/fileapprove/Makefile +++ b/utils/fileapprove/Makefile @@ -5,6 +5,11 @@ ifeq ($(OS), FreeBSD) CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib 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) CC=cc CFLAGS=-I/usr/pkg/include @@ -23,7 +28,6 @@ endif CC=cc -CFLAGS=-I/usr/local/include DEPS = fileapprove.c OBJ = fileapprove.o diff --git a/utils/magiftpd/Makefile b/utils/magiftpd/Makefile index 29c95ea..1775397 100644 --- a/utils/magiftpd/Makefile +++ b/utils/magiftpd/Makefile @@ -5,6 +5,11 @@ ifeq ($(OS), FreeBSD) CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib endif +ifeq ($(OS), DragonFly) + CC=cc + CFLAGS=-I/usr/local/include + LDFLAGS=-L/usr/local/lib +endif ifeq ($(OS), NetBSD) CC=cc CFLAGS=-I/usr/pkg/include diff --git a/utils/magimail/src/Makefile.linux b/utils/magimail/src/Makefile.linux index 9746431..5b6b2c2 100644 --- a/utils/magimail/src/Makefile.linux +++ b/utils/magimail/src/Makefile.linux @@ -40,7 +40,7 @@ MBOBJS = $(MBOBJS_MSG) $(MBOBJS_JAM) $(MBOBJS_SQ3) DEFS = $(PLATFORMDEF) $(MBDEFS) $(NLDEFS) # 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 else CC = gcc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -I $(INCDIR) -I ../../../deps/ -Wall diff --git a/utils/ticproc/Makefile b/utils/ticproc/Makefile index 37ed89f..ec2fb41 100644 --- a/utils/ticproc/Makefile +++ b/utils/ticproc/Makefile @@ -1,38 +1,43 @@ -OS := $(shell uname -s) - -ifeq ($(OS), FreeBSD) - CC=cc - CFLAGS=-I/usr/local/include - LDFLAGS=-L/usr/local/lib -endif -ifeq ($(OS), NetBSD) - CC=cc - CFLAGS=-I/usr/pkg/include - LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib -endif -ifeq ($(OS), Linux) - CC=gcc - CFLAGS= - LDFLAGS= -endif -ifeq ($(OS), Darwin) - CC=cc - CFLAGS= - LDFLAGS= -endif - - -DEPS = ticproc.c - -OBJ = ticproc.o ../../src/inih/ini.o crc32.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - - -ticproc: $(OBJ) - $(CC) -o ticproc $^ $(CFLAGS) $(LDFLAGS) -lsqlite3 - -.PHONY: clean - -clean: - rm -f $(OBJ) ticproc +OS := $(shell uname -s) + +ifeq ($(OS), FreeBSD) + CC=cc + CFLAGS=-I/usr/local/include + LDFLAGS=-L/usr/local/lib +endif +ifeq ($(OS), DragonFly) + CC=cc + CFLAGS=-I/usr/local/include + LDFLAGS=-L/usr/local/lib +endif +ifeq ($(OS), NetBSD) + CC=cc + CFLAGS=-I/usr/pkg/include + LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib +endif +ifeq ($(OS), Linux) + CC=gcc + CFLAGS= + LDFLAGS= +endif +ifeq ($(OS), Darwin) + CC=cc + CFLAGS= + LDFLAGS= +endif + + +DEPS = ticproc.c + +OBJ = ticproc.o ../../src/inih/ini.o crc32.o +%.o: %.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) + + +ticproc: $(OBJ) + $(CC) -o ticproc $^ $(CFLAGS) $(LDFLAGS) -lsqlite3 + +.PHONY: clean + +clean: + rm -f $(OBJ) ticproc