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 Apr 27 23:12:06 2014 +0200 (2014-04-27)
parents c53bcdabbba7
children f219f96f07c2
files Makefile
line diff
     1.1 --- a/Makefile	Sun Apr 27 23:12:06 2014 +0200
     1.2 +++ b/Makefile	Sun Apr 27 23:12:06 2014 +0200
     1.3 @@ -52,6 +52,9 @@
     1.4  xdgautostartdir ?= $(sysconfdir)/xdg/autostart
     1.5  
     1.6  OS_NAME :=	$(shell uname -s)
     1.7 +OS_RELEASE :=	$(shell uname -r)
     1.8 +
     1.9 +is_in = $(if $(filter $2, $1),true,false)
    1.10  
    1.11  PKGCONFIG_LIBS :=	dbus-1 glib-2.0 libnotify
    1.12  EXTRA_LIBS :=
    1.13 @@ -61,7 +64,13 @@
    1.14      EXTRA_LIBS +=	-lutempter
    1.15  else ifeq ($(OS_NAME),FreeBSD)
    1.16      OBJS_UTMP :=	xwrited-utmp-utempter.o
    1.17 -    EXTRA_LIBS +=	-lutempter
    1.18 +    FREEBSD_RELEASE_MAJOR := $(firstword $(subst ., ,$(OS_RELEASE)))
    1.19 +    # FreeBSD < 9.0 needs libutempter
    1.20 +    ifeq ($(call is_in, $(OS_RELEASE_MAJOR), 7 8), true)
    1.21 +	EXTRA_LIBS +=	-lutempter
    1.22 +    else
    1.23 +	EXTRA_LIBS +=	-lulog
    1.24 +    endif
    1.25  else
    1.26      OBJS_UTMP :=	xwrited-utmp-utmpx.o
    1.27  endif