Mercurial > projects > xwrited
changeset 3:6e2d746b06ae
Support FreeBSD > 9.0
FreeBSD 9.0 introduced a new utmpx.h interface and using utempter is no longer
possible or necessary. Adding entries to or removing them from the utmp
database still requires elevated privileges, the base system provides a
utempter-compatible interface with libulog which xwrited now makes use of.
author | Guido Berhoerster <guido+xwrited@berhoerster.name> |
---|---|
date | Sun, 27 Apr 2014 23:12:06 +0200 |
parents | c53bcdabbba7 |
children | f219f96f07c2 |
files | Makefile |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Sun Apr 27 23:12:06 2014 +0200 +++ b/Makefile Sun Apr 27 23:12:06 2014 +0200 @@ -52,6 +52,9 @@ xdgautostartdir ?= $(sysconfdir)/xdg/autostart OS_NAME := $(shell uname -s) +OS_RELEASE := $(shell uname -r) + +is_in = $(if $(filter $2, $1),true,false) PKGCONFIG_LIBS := dbus-1 glib-2.0 libnotify EXTRA_LIBS := @@ -61,7 +64,13 @@ EXTRA_LIBS += -lutempter else ifeq ($(OS_NAME),FreeBSD) OBJS_UTMP := xwrited-utmp-utempter.o - EXTRA_LIBS += -lutempter + FREEBSD_RELEASE_MAJOR := $(firstword $(subst ., ,$(OS_RELEASE))) + # FreeBSD < 9.0 needs libutempter + ifeq ($(call is_in, $(OS_RELEASE_MAJOR), 7 8), true) + EXTRA_LIBS += -lutempter + else + EXTRA_LIBS += -lulog + endif else OBJS_UTMP := xwrited-utmp-utmpx.o endif