ref: f383137fe1f92a9076d732f03ed628b5b087889d
parent: 4d063b84cc2bfd7a597fed6f5125f8d85b82b8f1
author: fstd <van.fisted@googlemail.com>
date: Sat Sep 12 17:32:00 EDT 2015
Consolidate BSD build to support NetBSD and OpenBSD as well
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@
vpath %.rc $(SRC_PATH)
vpath %.pc.in $(SRC_PATH)
-OS=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
+OS=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:]. | sed -E 's/^(net|open|free)bsd/bsd/')
ARCH=$(shell uname -m)
LIBPREFIX=lib
LIBSUFFIX=a
--- /dev/null
+++ b/build/platform-bsd.mk
@@ -1,0 +1,14 @@
+include $(SRC_PATH)build/arch.mk
+SHAREDLIBSUFFIX = so
+SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX).$(SHAREDLIBVERSION)
+SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
+CFLAGS += -fPIC
+LDFLAGS += -lpthread
+ifeq ($(ASM_ARCH), x86)
+ifeq ($(ARCH), x86_64)
+ASMFLAGS += -f elf64
+else
+ASMFLAGS += -f elf
+endif
+endif
+
--- a/build/platform-freebsd.mk
+++ /dev/null
@@ -1,14 +1,0 @@
-include $(SRC_PATH)build/arch.mk
-SHAREDLIBSUFFIX = so
-SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX).$(SHAREDLIBVERSION)
-SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
-CFLAGS += -fPIC
-LDFLAGS += -lpthread
-ifeq ($(ASM_ARCH), x86)
-ifeq ($(ARCH), x86_64)
-ASMFLAGS += -f elf64
-else
-ASMFLAGS += -f elf
-endif
-endif
-