Commit 98446d04 authored by Ondřej Surý's avatar Ondřej Surý

Various little quirks required to build on FreeBSD

parent 3060ee6d
...@@ -11,6 +11,8 @@ PREFIX ?= /usr/local ...@@ -11,6 +11,8 @@ PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin SBINDIR ?= $(PREFIX)/sbin
LIBDIR ?= $(PREFIX)/lib LIBDIR ?= $(PREFIX)/lib
PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
MANDIR ?= $(PREFIX)/share/man
INCLUDEDIR ?= $(PREFIX)/include INCLUDEDIR ?= $(PREFIX)/include
MODULEDIR ?= $(LIBDIR)/kdns_modules MODULEDIR ?= $(LIBDIR)/kdns_modules
ETCDIR ?= $(PREFIX)/etc/kresd ETCDIR ?= $(PREFIX)/etc/kresd
......
...@@ -46,8 +46,8 @@ daemon: $(kresd) ...@@ -46,8 +46,8 @@ daemon: $(kresd)
daemon-install: kresd-install bindings-install daemon-install: kresd-install bindings-install
ifneq ($(SED),) ifneq ($(SED),)
$(SED) -e "s/@VERSION@/$(MAJOR).$(MINOR).$(PATCH)/" -e "s/@DATE@/$(date)/" doc/kresd.8.in > doc/kresd.8 $(SED) -e "s/@VERSION@/$(MAJOR).$(MINOR).$(PATCH)/" -e "s/@DATE@/$(date)/" doc/kresd.8.in > doc/kresd.8
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man8/ $(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)/man8/
$(INSTALL) -m 0644 doc/kresd.8 $(DESTDIR)$(PREFIX)/share/man/man8/ $(INSTALL) -m 0644 doc/kresd.8 $(DESTDIR)$(MANDIR)/man8/
endif endif
daemon-clean: kresd-clean daemon-clean: kresd-clean
@$(RM) daemon/lua/*.inc @$(RM) daemon/lua/*.inc
......
...@@ -83,8 +83,8 @@ libkres.pc: ...@@ -83,8 +83,8 @@ libkres.pc:
@echo 'Libs: -L$${libdir} -lkres' >> $@ @echo 'Libs: -L$${libdir} -lkres' >> $@
@echo 'Cflags: -I$${includedir}' >> $@ @echo 'Cflags: -I$${includedir}' >> $@
libkres-pcinstall: libkres.pc libkres-install libkres-pcinstall: libkres.pc libkres-install
$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)
$(INSTALL) -m 644 $< $(DESTDIR)$(LIBDIR)/pkgconfig/ $(INSTALL) -m 644 $< $(DESTDIR)$(PKGCONFIGDIR)
# Targets # Targets
lib: $(libkres) lib: $(libkres)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#pragma once #pragma once
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/socket.h>
#include <libknot/packet/pkt.h> #include <libknot/packet/pkt.h>
#include "lib/cookies/control.h" #include "lib/cookies/control.h"
......
...@@ -30,29 +30,29 @@ ifeq ($(OS),Windows_NT) ...@@ -30,29 +30,29 @@ ifeq ($(OS),Windows_NT)
BINEXT := .exe BINEXT := .exe
else else
UNAME := $(shell uname -s) UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Darwin)
PLATFORM := Darwin PLATFORM := Darwin
LIBEXT := .dylib LIBEXT := .dylib
MODTYPE := dynamiclib MODTYPE := dynamiclib
# OS X specific hardening since -pie doesn't work # OS X specific hardening since -pie doesn't work
ifneq ($(HARDENING),no) ifneq ($(HARDENING),no)
BINFLAGS += -Wl,-pie BINFLAGS += -Wl,-pie
endif endif
# Version is prepended to dylib # Version is prepended to dylib
SOVER_EXT = .$(1)$(LIBEXT) SOVER_EXT = .$(1)$(LIBEXT)
SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),) SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),)
else else
PLATFORM := POSIX PLATFORM := POSIX
LDFLAGS += -pthread -lm -Wl,-E LDFLAGS += -pthread -lm -Wl,-E
# ELF hardening options # ELF hardening options
ifneq ($(HARDENING),no) ifneq ($(HARDENING),no)
BINFLAGS += -pie BINFLAGS += -pie
LDFLAGS += -Wl,-z,relro,-z,now LDFLAGS += -Wl,-z,relro,-z,now
endif endif
ifeq ($(UNAME),Linux) ifeq ($(UNAME),Linux)
LDFLAGS += -ldl LDFLAGS += -ldl
endif endif
endif endif
endif endif
# Silent compilation # Silent compilation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment