comparison Makefile @ 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 f0c7f45022c0
comparison
equal deleted inserted replaced
2:c53bcdabbba7 3:6e2d746b06ae
50 localedir ?= $(datadir)/locale 50 localedir ?= $(datadir)/locale
51 sysconfdir ?= /etc 51 sysconfdir ?= /etc
52 xdgautostartdir ?= $(sysconfdir)/xdg/autostart 52 xdgautostartdir ?= $(sysconfdir)/xdg/autostart
53 53
54 OS_NAME := $(shell uname -s) 54 OS_NAME := $(shell uname -s)
55 OS_RELEASE := $(shell uname -r)
56
57 is_in = $(if $(filter $2, $1),true,false)
55 58
56 PKGCONFIG_LIBS := dbus-1 glib-2.0 libnotify 59 PKGCONFIG_LIBS := dbus-1 glib-2.0 libnotify
57 EXTRA_LIBS := 60 EXTRA_LIBS :=
58 61
59 ifeq ($(OS_NAME),Linux) 62 ifeq ($(OS_NAME),Linux)
60 OBJS_UTMP := xwrited-utmp-utempter.o 63 OBJS_UTMP := xwrited-utmp-utempter.o
61 EXTRA_LIBS += -lutempter 64 EXTRA_LIBS += -lutempter
62 else ifeq ($(OS_NAME),FreeBSD) 65 else ifeq ($(OS_NAME),FreeBSD)
63 OBJS_UTMP := xwrited-utmp-utempter.o 66 OBJS_UTMP := xwrited-utmp-utempter.o
64 EXTRA_LIBS += -lutempter 67 FREEBSD_RELEASE_MAJOR := $(firstword $(subst ., ,$(OS_RELEASE)))
68 # FreeBSD < 9.0 needs libutempter
69 ifeq ($(call is_in, $(OS_RELEASE_MAJOR), 7 8), true)
70 EXTRA_LIBS += -lutempter
71 else
72 EXTRA_LIBS += -lulog
73 endif
65 else 74 else
66 OBJS_UTMP := xwrited-utmp-utmpx.o 75 OBJS_UTMP := xwrited-utmp-utmpx.o
67 endif 76 endif
68 77
69 ifeq ($(shell pkg-config --exists 'glib-2.0 >= 2.25.5' && printf "true"), true) 78 ifeq ($(shell pkg-config --exists 'glib-2.0 >= 2.25.5' && printf "true"), true)