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
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
LIBDIR ?= $(PREFIX)/lib
PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
MANDIR ?= $(PREFIX)/share/man
INCLUDEDIR ?= $(PREFIX)/include
MODULEDIR ?= $(LIBDIR)/kdns_modules
ETCDIR ?= $(PREFIX)/etc/kresd
......
......@@ -46,8 +46,8 @@ daemon: $(kresd)
daemon-install: kresd-install bindings-install
ifneq ($(SED),)
$(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) -m 0644 doc/kresd.8 $(DESTDIR)$(PREFIX)/share/man/man8/
$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)/man8/
$(INSTALL) -m 0644 doc/kresd.8 $(DESTDIR)$(MANDIR)/man8/
endif
daemon-clean: kresd-clean
@$(RM) daemon/lua/*.inc
......
......@@ -83,8 +83,8 @@ libkres.pc:
@echo 'Libs: -L$${libdir} -lkres' >> $@
@echo 'Cflags: -I$${includedir}' >> $@
libkres-pcinstall: libkres.pc libkres-install
$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/
$(INSTALL) -m 644 $< $(DESTDIR)$(LIBDIR)/pkgconfig/
$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)
$(INSTALL) -m 644 $< $(DESTDIR)$(PKGCONFIGDIR)
# Targets
lib: $(libkres)
......
......@@ -17,6 +17,7 @@
#pragma once
#include <netinet/in.h>
#include <sys/socket.h>
#include <libknot/packet/pkt.h>
#include "lib/cookies/control.h"
......
......@@ -30,29 +30,29 @@ ifeq ($(OS),Windows_NT)
BINEXT := .exe
else
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
PLATFORM := Darwin
LIBEXT := .dylib
MODTYPE := dynamiclib
# OS X specific hardening since -pie doesn't work
ifneq ($(HARDENING),no)
BINFLAGS += -Wl,-pie
endif
# Version is prepended to dylib
SOVER_EXT = .$(1)$(LIBEXT)
SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),)
else
PLATFORM := POSIX
LDFLAGS += -pthread -lm -Wl,-E
# ELF hardening options
ifneq ($(HARDENING),no)
BINFLAGS += -pie
LDFLAGS += -Wl,-z,relro,-z,now
endif
ifeq ($(UNAME),Linux)
LDFLAGS += -ldl
endif
endif
ifeq ($(UNAME),Darwin)
PLATFORM := Darwin
LIBEXT := .dylib
MODTYPE := dynamiclib
# OS X specific hardening since -pie doesn't work
ifneq ($(HARDENING),no)
BINFLAGS += -Wl,-pie
endif
# Version is prepended to dylib
SOVER_EXT = .$(1)$(LIBEXT)
SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),)
else
PLATFORM := POSIX
LDFLAGS += -pthread -lm -Wl,-E
# ELF hardening options
ifneq ($(HARDENING),no)
BINFLAGS += -pie
LDFLAGS += -Wl,-z,relro,-z,now
endif
ifeq ($(UNAME),Linux)
LDFLAGS += -ldl
endif
endif
endif
# 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